#走过, the way I tried
UPDATE information_schema. ' schemata ' SET default_collation_name= ' utf8_general_ci ' WHERE default_collation _name<> ' Utf8_general_ci ';
# ———— Try to use the UPDATE statement to modify, this is not working, the following error does not have permissions.
#错误代码: 1044
#Access denied for user ' root ' @ '% ' to database ' Information_schema '
# after the Niang find the data, you need to use the ALTER statement to modify the DB character set
ALTER DATABASE mydb CHARACTER SET UTF8;
#第一步, find the database in the MySQL instance where the character set is not UTF8
SELECT * from WHERE Default_collation_name<>'utf8_general_ci';
#第二步, modifying the character set
#如果MySQL实例上有多个数据库需要将字符集改为utf8, we can take the following strategy:
#2.1 using the Concat function, I believe you can see the following statement, you should be able to know what to do next.
SELECT *, CONCAT (', schema_name,' CHARACTER SET UTF8; ' from WHERE Default_collation_name<>'utf8_general_ci';
#2.2 Copy the result of the previous select, paste, and finally execute
ALTER DATABASE CHARACTER SET UTF8; ALTER DATABASE CHARACTER SET UTF8; ALTER DATABASE CHARACTER SET UTF8, .......
#第三步, check that validation is successful
SELECT * from WHERE Default_collation_name<>'utf8_general_ci';
#<r> query: SELECT * from INFORMATION_SCHEMA. ' schemata ' WHERE default_collation_name<> ' utf8_general_ci ' LIMIT 0, 1000
#返回了 0 Rows
#结果表明, there is no character set that's not UTF8 's library anymore.
Done!
MySQL bulk modifies the character set of the database