In the development process will often use the MySQL Export Import Chinese table, this article will explain in detail how it is used, the need for friends can refer to.
In the development process will often use the MySQL Export Import Chinese table, this article will explain in detail how it is used, the need for friends can refer to the following
First, for UTF8 export:
(1) Export all tables from the source database:
The code is as follows:
- - --
(2) Modify the SQL file to delete the command that contains the database created in the file header
(3) Login to target database
Mysql-uroot-p Password--default-character-set=utf8--socket=mysql.sock-a
Note: You must specify a character set login, and the specified character set should match the character set specified at export
(4) Delete database (if any)
drop database name;
(5) Create a database and save it as a UTF8 storage format and import
The code is as follows:
Create database name CharSet= use
After this import, the Chinese table may be garbled. So, to import the Chinese table, use the following method.
Second, Export Import Chinese table:
The code is as follows:
- - -- ----use database name; source Gbk.sql EOF
[Turn]mysql Export Import Chinese table resolution method