-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange string appear when I backup a Chinese "JSON" type column. #57
Comments
Here is my code:
|
It could be the chatset issue. Try get the info of the table:
and see what is the default charset used by the table |
Here is the result.
|
Try this:
You may execute this line after all the process completed to avoid memory leak. You may skip this if you're doing this in ASP.NET page.
|
QAQ It doesn't work. |
Could you please help me to solve this problem? Thanks. |
Can you provide the SQL dump that you created by using MySqlWorkbench or MySqlDump? |
You may upload the dump file as attachment in your next reply |
I have dropped my test datas before and I created a sql file which contains one row data to upload. The structure of this sql file is same as the former one. Thank you very much! |
Hi, I have run a quick test on my computer. It runs perfectly alright in both import and export. The chinese characters are shown correctly. Therefore, I think the problem might be the settings of the MySql server. The first thing came into my mind is still the character set.
|
Thanks @adriancs2 a lot! It works! I checked my setting once again and you are right. MysqlBackup.NET备份Mysql 5.7以上版本的json字段出现乱码有可能是数据库字符集默认设置为gbk。可以通过修改mysql的配置文件中的两个配置项进行配置。
我曾尝试使用mysql的命令行进行修改,发现可能不能达到永久修改的目的。 |
And now I am not using the code
It works perfectly, too. |
I backup a database and there is a table which has a "JSON" type column. Some filed in the json column is Chinese. After backup it becomes strange string, not Chinese.
I had met this situation. I got same solution when I use mysql command "select json_list_name from table;" through Mysql.Data.
When I use "select json_unquote(json_list_name ) from table;", it become normal.
Hope this issue helpful.
使用MySqlBackup.NET备份中文JSON字段的时候乱码
The text was updated successfully, but these errors were encountered: