phpMyAdmin Creating a database setting default encoding

Source: Internet
Author: User
Tags phpmyadmin

PHP uses a database when doing projects. When you create a database, you will inevitably enter Chinese characters. But in the SQL command console, the SQL statements are inserted in Chinese, and the final query comes out with the results. instead of. Looked very headache. I was just starting out. Set the default encoding in the phpMyAdmin, first change the database encoding method, and then change the table encoding method, in the field encoding. It's very annoying. The watermelon knives were taken out at the foot. Forgive my not calm, then how to create a database in phpmyadmin The default encoding is Utf-8 ?

Here I introduce this method, once and for all.

phpMyAdmin the default encoding for creating a database is: latin1_swedish_ci

The way to modify the default encoding is

1. Login phpMyAdmin

2. In the navigation section point: Variable

3.ctrl+f Find: Latin1_swedish_ci

4. Change all the latin1_swedish_ci with the desired encoding, I set to: Utf8_general_ci

Come on, you!

You can then enter in the SQL command console: Show variables like '%char% ';

Found that there are latin1, that is, psoriasis is really annoying ah. Continue to change

command line input set Character_set_database=utf8;

Enter set Character_set_server=utf8 again; (These two are not the same Ah, note)

It's done. Hemp no longer have to worry about my SQL results are garbled. Do not worry about the child shoes can continue to enter:show variables like '%char% ', this sentence to see whether the success. This is mine.

Finally, thank you for watching. Have time to exchange PHP together.

phpMyAdmin Creating a database setting default encoding

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.