当我使用 mysqldump 导出 mysql 数据库时,它总是产生一个 dump.sql 包含
...some other things...
/*!40101 SET character_set_client = utf8*/;
...some other things...
Run Code Online (Sandbox Code Playgroud)
这是我使用的 mysqldump 命令:
mysqldump -u root -p databaseName -R -E --single-transaction --default-character-set=utf8mb4 > dump.sql
Run Code Online (Sandbox Code Playgroud)
mysql数据库的字符集是utf8mb4
而不是utf8
,字符相关的变量是:
...some other things...
/*!40101 SET character_set_client = utf8*/;
...some other things...
Run Code Online (Sandbox Code Playgroud)
为什么mysqldump总是添加
/*!40101 SET character_set_client = utf8*/
而不是
/*!40101 SET character_set_client = utf8mb4*/
?
如果/*!40101 SET character_set_client = utf8*/
使用会发生什么?
我们可以使用mysqldump/*!40101 SET character_set_client = utf8mb4*/
吗?