MariaDBインストールおよび文字セット構成

2298 ワード

MariaDBインストールおよび文字セット構成
MariaDBデータベース管理システムはMySQLのブランチです
インストール
#   
$ yum -y install mariadb mariadb-server mariadb-devel
#     
$ systemctl start mariadb         #   mariadb
$ systemctl enable mariadb        #       
$ mysql_secure_installation       #   mariadb
mysql> grant all on *.* to '   '@'%' identified by '  ';   #   

文字セットの構成
$ vim /etc/my.cnf
#  [mysqld]     
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
# =======================================================
$ vim /etc/my.cnf.d/client.cnf
#  [client]   
default-character-set=utf8
=======================================================
$ vim /etc/my.cnf.d/mysql-clients.cnf
#  [mysql]   
default-character-set=utf8
# =======================================================
#       ,  mariadb
$ systemctl restart mariadb
#   MariaDB     
mysql> show variables like "%character%";show variables like "%collation%";
 :skip-character-set-client-handshake          ,        ;         UTF8