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 © 试剑江湖 2020 all right reserved,powered by Gitbook修订时间: 2023-02-26 13:36:34

results matching ""

    No results matching ""