Mysql报错:Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation ‘=’ in MySQL Stored Procedure

如果MySQL命令报错:

MySql: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation ‘=’

请尝试执行下面的命令:

alter table `dbname`.`tablename` convert to character set utf8 collate utf8_general_ci;

如果想要执行全部table,可以参考:

Terminal – Convert all MySQL tables and fields to UTF8

mysql --database=dbname -B -N -e "SHOW TABLES" | awk '{print "ALTER TABLE", $1, "CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;"}' | mysql --database=dbname &

 

本文:Mysql报错:Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation ‘=’ in MySQL Stored Procedure

Leave a Reply