wcps8Server\mysql57\my.ini
注意:mysql访问时要使用支持utf8mb4的客户端进行访问
--查询字符集(验证字符集修改成果)
SHOW VARIABLES LIKE 'character%';
ALTER DATABASE wcp CHARACTER SET = utf8mb4
SELECT CONCAT( "alter table ", TABLE_NAME, " drop foreign key ", CONSTRAINT_NAME, "; " ) AS runMe FROM information_schema.key_column_usage WHERE TABLE_SCHEMA = 'wcp' AND CONSTRAINT_NAME <> 'PRIMARY';
批量生成修改表编码的SQL
SELECT CONCAT( 'ALTER TABLE ', TABLE_NAME, ' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;' ) as run_sql FROM information_schema.`TABLES` WHERE TABLE_SCHEMA = 'wcp';
character_set_server=utf8mb4
------------------------------------可选--------------------------------------
**批量生成索引**
SELECT CONCAT( "create index IA_", TABLE_NAME,"_",column_name, " on ", TABLE_NAME,"(",column_name,")" "; " ) AS runMe FROM information_schema.key_column_usage WHERE TABLE_SCHEMA = 'wcp' AND CONSTRAINT_NAME <> 'PRIMARY';
备注 | 修改日期 | 修改人 |
内容更新 | 2024-01-18 12:29:51[当前版本] | 系统管理员1 |
内容更新 | 2024-01-18 11:48:09 | 系统管理员1 |
内容更新 | 2024-01-18 11:44:53 | 系统管理员1 |
创建版本 | 2024-01-18 11:42:58 | 系统管理员1 |
附件类型 | TXT PNG |
|
|