[Turn]mysql Export Import Chinese table resolution method

Source: Internet
Author: User

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

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.