In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to solve the problem of garbled phpmyadmin exported sql files. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Phpmyadmin export sql file garbled how to do?
The phpMyAdmin version is 2.9.1.1
Back up the database with phpMyAdmin, and when you restore it locally with sqlyog, the following error occurs:
Error occured at:2009-03-03 10:09:43Line no.:11154Error Code: 1062-Duplicate entry'? For key 2
Open the sql file to take a look, the member user name under the membership table is garbled, all similar to? Because now many programs support Chinese user names, and the user name is unique, after the Chinese user name becomes garbled, there are many of the same usernames, and when we import these garbled data, there are already? This user name is used, so the second one below is wrong.
If you have control of the system, you can export the data with the following command. There will be no garbled code, and it will be normal during restore.
Mysqldump-uroot-p-- default-character-set=utf8-- set-charset-- skip-opt dbname > newdbname.sql
But now it can only be exported with phpMyAdmin, and after testing for a long time, it is found that if the Language of phpMyAdmin is "Chinese-chinese simplified-gb2312", the exported sql file is gb2312, and some tables contain Chinese, and the Chinese is garbled. When the Laguage of phpMyAdmin is "Chinese-chinese simplified (that is, utf8)", the character set of the exported sql file is utf8 (in Notepad++ format, the display is UTF-8 without BOM format coding), and the Chinese in the table can be displayed normally.
Therefore, in order to avoid Chinese garbled in the exported file, you can choose Chinese-chinese simplified from the Language drop-down menu, and then select Export, and the Chinese in the downloaded sql file can be displayed normally.
Restore with the following command
Mysql-uroot-p-- default-character-set=utf8 newdbname < newdbname.sql
Originally wanted to change the default Language of phpMyAdmin to "Chinese-chinese simplified", but tried to modify the config.default.php under the config.inc.php and libraries directories are useless, it doesn't matter, after all, different people choose the database code is different, there is always someone to re-choose the language, or let it default to "Chinese-chinese simplified-gb2312" it!
Guess another solution is that the exported file encoding is gb2312, so you can consider converting gb2312 to utf8. This method is being tested.
Thank you for reading! This is the end of this article on "how to solve the problem of garbled phpmyadmin exported sql files". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.