ps -ef |grep mysql 查看mysql服务是否运行
vim /etc/my.cnf 配置文件
show variables like "%char%"; 查看字符集
[mysqld]
character-set-server=utf8
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
将字符集格式加入 vim /etc/my.cnf 配置文件中,重启数据库服务后,字符变成utf8
systemctl start mariadb.service 启动
systemctl stop mariadb.service 关闭
systemctl restart mariadb.service 重启