批量设置mysql表编码
生成修改的代码
SELECT CONCAT('ALTER TABLE ', table_name, ' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;') FROM information_schema.TABLES WHERE TABLE_SCHEMA = '数据库名称'
小于 1 分钟
这是一个个人的博客
SELECT CONCAT('ALTER TABLE ', table_name, ' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;') FROM information_schema.TABLES WHERE TABLE_SCHEMA = '数据库名称'