Sometimes when we are developing, we need to use the mysql database. How to prevent Chinese garbled characters from appearing. The editor below will share how to set the encoding method of the mysql database
Mysql client to view and modify the encoding method
1. The first step is to open the mysql software, enter the password, and press the Enter key, as shown in the following figure:
2. In the second step, enter "use day14_customer;" on the command line, press Enter, enter the database, pay attention to the last semicolon, day14_customer is the name of the database, As shown in the figure below:
##3. In the third step, enter "show create database day14_customer;" to view the database Encoding method
“alter database day14_customer default character set gbk;”
mysql graphical interface to modify the viewing encoding method
Test whether the database encoding contains Chinese garbled characters
1. The first step is to open the table in our database and click "Table Data" on the right
##
The above is the detailed content of How to set and view MySQL database encoding. For more information, please follow other related articles on the PHP Chinese website!