安装与测试登陆
yum -y install mariadb mariadb-server
systemctl start mariadb
mysql_secure_installation
mysql -uroot -psecret
配置MariaDB的字符集
vi /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
vi /etc/my.cnf.d/client.cnf
[client]
default-character-set=utf8
vi /etc/my.cnf.d/mysql-clients.cnf
[mysql]
default-character-set=utf8
systemctl restart mariadb
进入MariaDB查看字符集
MariaDB [(none)]> show variables like “%character%”;show variables like “%collation%” ;