In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Mysql imported from the file sql garbled problem how to solve, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
First of all, I got the sql file without garbled code (you can see the file encoding using the ultraedit administrator interface)
Database coding is consistent with file
Next, let's go into mysql and take a look at variables.
Www.2cto.com
Mysql > show variables like "char%"
+-+
| | Variable_name | Value |
+-+
| | character_set_client | latin1 |
| | character_set_connection | latin1 |
| | character_set_database | utf8 |
| | character_set_filesystem | binary |
| | character_set_results | latin1 |
| | character_set_server | utf8 |
| | character_set_system | utf8 |
| | character_sets_dir | / usr/local/Percona-Server-5.1.57-rel12.8-233--x86_64/share//charsets/ |
+-+
8 rows in set (0.01 sec)
Www.2cto.com
Mysql > show variables like "coll%"
+-+ +
| | Variable_name | Value |
+-+ +
| | collation_connection | latin1_swedish_ci |
| | collation_database | utf8_bin |
| | collation_server | utf8_bin |
+-+ +
3 rows in set (0.00 sec)
There are several latin1's.
The variable that turns out to be connection is latin1... Can't stand it.
Modify the sql file
SET collation_connection = utf8_bin
SET character_set_client = utf8
SET character_set_connection = utf8
Mysql-- socket=/opt/mydata/my3306/my3306.sock-A < xxx.sql would be fine.
After reading the above, do you know how to solve the problem of garbled code when mysql imports sql from the file? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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
CREATE OR REPLACE PACKAGE KMP_ALGOR_PKGASTYPE next_arr_tt IS TABLE OF INT INDEX BY PLS_INTEGER;PROCE
© 2024 shulou.com SLNews company. All rights reserved.