phpmyadmin database garbled?
1. Check the server code in phpMyAdmin
After logging in to phpMyAdmin, you can see the server code on the homepage
Recommended: "mysql tutorial》
#From the picture, we see that the encoding of this MySQL server is UTF-8 Unicode (utf8).
2. Specify the character set when creating the database in phpMyAdmin
When we talked about the priority of the character set earlier, we said that the priority of the database character set is higher than the priority of the server. The process of creating a database and specifying the character set in phpMyAdmin is as follows:
The name of the database in the figure is Baidusql, and the character set is gbk_chinese_ci, which is gbk.
If you need to modify the character set of the database, you can select the database, then click the "Operation" option, find the option you need in the "Organization" drop-down list, and then click the "Execute" button
3. Create a table in phpMyAdmin and specify the character set
When creating a table, first fill in the table name and field name, and click the execute button
In the creation page, the default option for sorting is empty. If not selected, the character set of the database will be inherited by default.
If you have special needs, you can specify it yourself, otherwise it is recommended to keep the default value.
After entering the data, the Chinese display is normal!
The above is the detailed content of phpmyadmin database garbled code. For more information, please follow other related articles on the PHP Chinese website!