When I use mysqldump to export mysql database, it always produce a dump.sql containing
...some other things...
/*!40101 SET character_set_client = utf8*/;
...some other things...
This is the mysqldump command I use:
mysqldump -u root -p databaseName -R -E --single-transaction --default-character-set=utf8mb4 > dump.sql
The charset of the mysql database is utf8mb4
rather than utf8
, the characters related variables is:
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
| collation_connection | utf8mb4_unicode_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
+--------------------------+----------------------------+
Why does mysqldump always add
/*!40101 SET character_set_client = utf8*/
rather than
/*!40101 SET character_set_client = utf8mb4*/
?
What happens if /*!40101 SET character_set_client = utf8*/
is used?
Can we have mysqldump use /*!40101 SET character_set_client = utf8mb4*/
?