Linux-013-Centos mysql 5.6.50 修改字符集为 utf8

# 查看数据库字符集

mysql > show variables like 'character%';

 

# 先将 mysql 服务停止,然后继续后续操作

# 数据库停止
systemctl stop mysqld.service

 

# 查看数据库状态
systemctl status mysqld.service

 

 

 

# 修改数据库字符集
vi /etc/my.cnf
[client]
default-character-set = utf8

[mysql]
default-character-set = utf8

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8
collation-server = utf8_unicode_ci
init_connect='SET NAMES utf8'


# 数据库启动
systemctl start mysqld.service

 

# 查看数据库字符集

mysql > show variables like 'character%';

 

posted @ 2020-10-27 22:36  范丰平  Views(126)  Comments(0Edit  收藏  举报