Home  >  Article  >  Database  >  What should I do if mysql command line displays garbled characters in Chinese?

What should I do if mysql command line displays garbled characters in Chinese?

coldplay.xixi
coldplay.xixiOriginal
2020-10-27 14:57:173454browse

Solution to the Chinese display of garbled characters in the mysql command line: 1. The reason for the garbled characters is that the lastin code is used when logging in, so you need to log out again and use the encoding to log in clearly; 2. Query the Chinese table again; 3. Log in The encoding must be the same as the encoding used when installing the database.

What should I do if mysql command line displays garbled characters in Chinese?

Mysql command line Chinese display garbled solution:

1. When we use mysql -u root directly -proot logs in to the command line interface.

What should I do if mysql command line displays garbled characters in Chinese?

#2. When there are Chinese characters in the table, garbled characters will appear.

What should I do if mysql command line displays garbled characters in Chinese?

#3. The reason for this garbled code is that the lastin code is used when logging in, so you need to log out again and use the code to log in clearly.

What should I do if mysql command line displays garbled characters in Chinese?

#4. Log in again to solve the problem of garbled Chinese query tables.

What should I do if mysql command line displays garbled characters in Chinese?

#5. Query the Chinese table again, and we can see that there is no problem with Chinese garbled characters.

What should I do if mysql command line displays garbled characters in Chinese?

# 6. One thing to note is that the encoding we use when logging in must be the same as the encoding we use when installing the database, so as to solve the problem of garbled characters. My database encoding is gbk, so I use gbk when logging in. This solves the problem of Chinese garbled characters when logging in through the command line interface.

What should I do if mysql command line displays garbled characters in Chinese?

More related free learning recommendations: mysql tutorial(Video )

The above is the detailed content of What should I do if mysql command line displays garbled characters in Chinese?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn