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

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.