MySQL default_character_set_name

SELECT default_character_set_name FROM information_schema.SCHEMATA S WHERE schema_name = "DATABASE_NAME";
ALTER DATABASE DATABASE_NAME CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER DATABASE DATABASE_NAME CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE TABLE_NAME CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE TABLE_NAME CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;

引用:
mysql – How to fix “Incorrect string value” errors? – Stack Overflow
character encoding – How to convert an entire MySQL database characterset and collation to UTF-8? – Stack Overflow

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据