# 查看数据库字符集

mysql > show variables like 'character%';

 

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

# 数据库停止
systemctl stop mysqld.service

 

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

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

 

 

 

# 修改数据库字符集
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%';

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

 

相关文章:

  • 2021-11-28
  • 2021-11-28
  • 2021-06-12
  • 2021-06-25
  • 2021-07-24
  • 2022-02-08
  • 2021-07-23
猜你喜欢
  • 2021-11-28
  • 2021-11-28
  • 2021-11-28
  • 2022-01-14
  • 2021-11-28
  • 2021-11-28
相关资源
相似解决方案