- 查看编码
show variables like 'character%';
- 更改编码
SET character_set_client = utf8;
SET character_set_connection = utf8;
SET character_set_database = utf8;
SET character_set_results = utf8;
SET character_set_server = utf8;
但是这个只在当前环境下有效,数据库重启之后设置消失。
- 持久化需要修改 my.cnf
网友评论