In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you the "mysql 5.6Chinese garbled code how to do", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "mysql 5.6Chinese garbled code how to do" this article.
Mysql5.6 Chinese garbled solution: 1, find the my.ini;2 under the MySQL installation directory, set "default-character-set=utf8" and "character_set_server=utf8"; 3, restart the MYSQL service.
This article operating environment: Windows7 system, mysql5.6 version, Dell G3 computer.
The problem of Chinese garbled codes in MySQL 5.6( especially the gbk coding of windows)
General MySQL database garbled is caused by the following situations (in order): 1. No encoding is set when creating the database. The solution is to set the encoding when creating the database, for example: CREATE DATABASE `mydb` CHARACTER SET utf8 COLLATE utf8_general_ci;2. The database engine code is not set when the data table is created. The solution: when CREATE TABLE `tb_ album` (`id` bigint (20) NOT NULL AUTO_INCREMENT, `name` varchar (100) NOT NULL DEFAULT'', PRIMARY KEY (`id`) ENGINE=InnoDB DEFAULT CHARSET=utf8;3.MySQL imports .sql file, the Chinese characters are garbled due to coding problems. First enter the database mysql-u root-p and enter the password, then enter the command to view the encoding show variables like 'char%'.
You will find that many codes default to gbk, and character_set_server (which is the reason for garbled code when importing .sql files) defaults to latin1. Others can be modified (permanently modified) on the mysql console by the command set xxx = utf8;, but not character_set_server. Login is still latin1 after exit.
Solution: find the my.ini under the MySQL installation directory, set up default-character-set=utf8 and character_set_server=utf8. If your MySQL is installation-free, there is no my.ini. There are only my-default.ini files in the installation directory, and there is no character-set-server on it. Make a copy of my-default.ini first. And rename it to my.ini, so that there are two ini files, my.ini and my-default.ini, in this directory, and then open my.ini with the following three lines of code [client] default-character-set=utf8 / [mysqld] / character-set-server=utf8
The specific locations are as follows:
Then restart the MYSQL service and find that character-set-server is no longer a latin1:
If your MySQL is installed, find my.ini, set up default-character-set=utf8 and character-set-server=utf8, and restart the MySQL service. The above is all the contents of the article "what to do with mysql 5.6Chinese garbled codes". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.