In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you the solution to the 1062 error in mysql. I hope you will gain a lot after reading this article. Let's discuss it together.
The solution to the 1062 error in mysql: first open the configuration file [my.cnf] of mysql, then add relevant code under client and mysqld, and restart mysql after closing the last memory.
The solution to a 1062 error in mysql:
The versions of the two instance are similar, so guess is not a version problem. The two DB executing the sql statement are imported in the same way, so it is suspected that it is the character set of the database.
Check the character set configuration of mysql:
Show variables like 'collation_%';show variables like' character_set_%'
As a result, when the utf-8 is running normally, the error is latin1, as shown in the following figure.
The cause and solution of an error in mysql ERROR 1062
So modify the mysql character set configuration.
1. Open mysql's configuration file my.cnf
two。 Add a line under [client]:
Default-character-set=utf8
3. Add the following under [mysqld]:
Default-character-set=utf8
4. Restart mysql:service mysql restart after the save is closed
If you look at the character set of mysql again, it should become utf8.
If the mysql version is 5.5.x and the ubuntu12.04 OS is used, the mysql service may fail to start after the above configuration. Replace the change in [mysqld] in step 3 with:
3. Add the following under [mysqld]:
Character-set-server=utf8
It should be normal to restart after saving.
After reading this article, I believe you have some understanding of the solution to the 1062 error in mysql. If you want to know more about it, welcome to follow the industry information channel. Thank you for your 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
© 2024 shulou.com SLNews company. All rights reserved.