5.5以前可以命令行改编码重启生效

也可以通过改配置文件来实现 /etc/my.cnf(我的系统是阿里云的Ubuntu系统)

[client] 和[mysqld]下面加

default-character-set=utf8

可是5.5以后这样改配置文件是行不通的,服务起不来

应该

[client]加

default-character-set=utf8

[mysql]加

character-set-server=utf8


重启服务  service mysqld start

mysql -uroot -p123456

show variables like 'character%';

show  variables like 'coll%';


mysql 5.5以后的版本乱码mysql 5.5以后的版本乱码

mysql 5.5以后的版本乱码


转载于:https://my.oschina.net/zvc/blog/355366

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
  • 2022-02-08
  • 2022-12-23
  • 2021-06-19
  • 2021-07-15
  • 2021-09-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-25
  • 2021-11-25
  • 2021-04-27
  • 2021-07-05
  • 2022-12-23
相关资源
相似解决方案