批量拼接修改字段的字符集:
SELECT CONCAT('ALTER TABLE `', TABLE_SCHEMA,'`.`',TABLE_NAME, '` MODIFY COLUMN `',COLUMN_NAME,'` ',COLUMN_TYPE,' CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT "',COLUMN_COMMENT,'";') as 'sql'
FROM information_schema.`COLUMNS`
where TABLE_SCHEMA='test'
and CHARACTER_SET_NAME is not null
批量拼接修改表的字符集:
SELECT CONCAT('ALTER TABLE `',TABLE_NAME,'` CHARACTER SET = utf8mb4, COLLATE = utf8mb4_general_ci;') as a2
FROM information_schema.`TABLES`
WHERE TABLE_SCHEMA='test'
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。