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.
Mysql command line Chinese display garbled solution:
1. When we use mysql -u root directly -proot logs in to the command line interface.
#2. When there are Chinese characters in the table, garbled characters will appear.
#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.
#4. Log in again to solve the problem of garbled Chinese query tables.
#5. Query the Chinese table again, and we can see that there is no problem with Chinese garbled characters.
# 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.
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!