linux,执行mysql报Incorrect string value乱码问题,

tech2022-08-11  128

1、打开mysql的配置文件

#每个人的配置文件路径都不一样的 vim /etc/my.cnf

2、加入下面代码,注意我的图

[mysqld] character-set-server=utf8mb4 [mysql] default-character-set=utf8mb4

3、重启mysql

systemctl restart mysqld

4、最后,修改表编码格式

alter table 表名 convert to character set utf8mb4 collate utf8mb4_bin;
最新回复(0)