If the character set on the MySQL server is latin1, the Chinese characters in the mysqldump output will be garbled! A simple solution is to add the default character set option. For example:
mysqldump -h 127.0.0.1 -P 3307 -u username --default-character-set=gbk -p databasename > dumpfile.txt
Parameter explanation:
-hHost-PPort, must be specified separately and cannot be written continuously after the host address-uUsername--default-character-setWhen you know the data content is in Chinese, you can specify it asgbk. This way, even if the database itself is set to thelatin1character set, the output file will display Chinese characters correctly!-pPassworddatabasenameDatabase name>The path of the output file follows this symbol.
Original Link: https://snowpeak.blog.csdn.net/article/details/2621265