Solve the problem of Chinese garbled characters in MySQL5.5 database command lines in Windows 10, windows10mysql5.5

Source: Internet
Author: User

Solve the problem of Chinese garbled characters in MySQL5.5 database command lines in Windows 10, windows10mysql5.5

After the system is reset, the MySQL database installed a long time ago experienced Chinese garbled characters in the console query. It took too long to remember how to set it.

A lot of queries are made online, and various settings are still garbled in Chinese after the database is restarted.

It may be that my search method is incorrect, but I have solved the problem in the end. Open a ticket to record it:

Open the my. ini file in the installation directory

My Files are: C: \ Program Files \ MySQL Server 5.5, and the modifications are as follows:

[Client] default-character-set = utf8port = 3306 [mysql] # many answers to this gbk on the Internet are also set to utf8, the result is garbled default-character-set = gbk # server section # -------------------------------------------------------------- # the following options will be read by The MySQL Server. make sure that # you have installed the server correctly (see above) so it reads this # file. # [mysqld] # The TCP/IP Port the MySQL Server will listen onport = 3306 # Path to installation directory. all paths are usually resolved relative to this. basedir = "C:/Program Files/MySQL Server 5.5/" # Path to the database rootdatadir = "C: /ProgramData/MySQL Server 5.5/Data/"# The default character set that will be used when a new schema or table is # created and no character set is definedcharacter-set-server = utf8collation-server = utf8_general_ci restart mysql after modification, check the encoding: mysql> show variables like 'character _ set % '; + bytes + | Variable_name | Value | + bytes + | character_set_client | gbk | character_set_connection | gbk | character_set_database | utf8 | bytes | binary | gbk | | character_set_server | utf8 | character_set_system | utf8 | character_sets_dir | C: \ Program Files \ MySQL Server 5.5 \ share \ charsets \ | + ------------------------ + examples + operation test: mysql> insert into per values ('garbled work'); Query OK, 1 row affected (0.00 sec) mysql> select * from per; + -------------- + | name | + -------------- + | various requests | garbled solution | + -------------- + 3 rows in set (0.00 sec)

Summary

The above is a small series of articles about how to solve the Chinese garbled characters in MySQL database command line in Windows 10. I hope to help you. If you have any questions, please leave a message for me, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.