Phpmyadmin creates a database and sets the default encoding, phpmyadmin Encoding

Source: Internet
Author: User

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.

Walk you!

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.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.