SELECT
CONCAT( 'ALTER TABLE ', TABLE_NAME, ' DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;' ) AS '修正SQL'
FROM
information_schema.`TABLES`
WHERE
TABLE_COLLATION != 'utf8mb4_unicode_ci'
AND TABLE_SCHEMA = 'edu-integrated';
SELECT
CONCAT( 'ALTER TABLE ', TABLE_NAME, ' MODIFY COLUMN `', COLUMN_NAME, '` ', COLUMN_TYPE, ' CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;' ) AS '修正SQL'
FROM
information_schema.`COLUMNS`
WHERE
( CHARACTER_SET_NAME != 'utf8mb4' OR COLLATION_NAME != 'utf8mb4_unicode_ci' )
AND TABLE_NAME NOT LIKE 'v_%'
AND TABLE_SCHEMA = 'edu-integrated';