1. 解决MariaDB中文乱码

1、检查自己数据库编码

# mysql -uroot -proot
# show VARIABLES like 'char%';

2、更改Client和Server编码都是UTF-8

# vim /etc/my.cnf.d/server.cnf

server.cnf[mysqld]标签下添加代码

    init-connect='SET NAMES utf8'
    character-set-server = utf8

重启MariaDB即可
# systemctl restart mariadb
--- 如果已经添加为服务
# service mysqld restart
Copyright © 試毅-思伟 2019 all right reserved,powered by 試毅-思伟修订时间: 2019-07-02 13:44:28

results matching ""

    No results matching ""