Home  >  Article  >  Database  >  Where does phpmyadmin set utf_8

Where does phpmyadmin set utf_8

尚
Original
2020-01-14 16:38:203283browse

Where does phpmyadmin set utf_8

1. How to set the default encoding of a new database to utf8 encoding in phpmyadmin

1. Create a new database my_db

2. Use sql Statement

set character_set_server=utf8; //Set the default new database encoding to utf8

alter database testdb character set utf8; //Change the existing database encoding

2. phpmyadmin Settings for gbk or utf8 encoding when importing the database (solve the problem of Chinese garbled characters when importing the database)

1. First, make sure that the Chinese in the imported sql file is not garbled. This sql file can be utf8 encoded or gb2312 encoded. It doesn’t matter

2. Add set names utf8 or gb2312; at the beginning of the sql file (must be the same as the encoding of your file. If you want to import utf8, your file encoding must be utf8. If you If you want to import it as gbk/gb2312, your file encoding must be gbk/gb2312).

3. Just import directly through the phpmyadmin import interface.

3. Click Modify in the data table of phpmyadmin, and then modify the sorting rules to set utf_8.

Where does phpmyadmin set utf_8Recommend learning "phpmyadmin"

The above is the detailed content of Where does phpmyadmin set utf_8. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn