Phpmyadmin creates a database and sets the default encoding, phpmyadmin Encoding
The database is used for php projects. When creating a database, you will inevitably enter Chinese characters. However, in the SQL command console, when the SQL statement is inserted into Chinese characters and finally queried, the results are as follows? . It's a headache. At the beginning, I set the default encoding in phpmyadmin. First, I changed the database encoding method and then the table encoding method. Very annoying. All the watermelon knives under your feet were taken out. Sorry, I am not calm. How can I set the default encoding to UTF-8 when creating a database in phpmyadmin?
I will introduce this method once and for all.
The default encoding for phpmyadmin to create a database is latin1_swedish_ci.
The default encoding method is
1. log on to phpmyadmin
2. In the navigation area, click variable.
3. Ctrl + F search: latin1_swedish_ci
4. Change all latin1_swedish_ci to the desired encoding. I set it to utf8_general_ci.
Then, enter: show variables like '% char %' in the SQL command console ';
Latin1 is also found to be as annoying as psoriasis. Continue to change
Enter set character_set_database = utf8 in the command line;
Enter set character_set_server = utf8 again. (These two are different. Note that)
This is all done. Ma no longer has to worry about garbled SQL results. If you are not at ease, enter show variables like '% char %. This is my
Finally, thank you for watching. If you have time to talk about php.