Mysql Import Export CSV Chinese problem solving method _mysql

Source: Internet
Author: User

Import CSV:

Copy Code code as follows:

Load data infile '/test.csv ' into table table_name
Fields terminated by ', ' optionally
Enclosed by ' "' escaped by '"
Lines terminated by ' \ r \ n '
Ignore 1 lines;

Guide CSV:

Copy Code code as follows:

SELECT * into outfile '/test.csv '
FIELDS terminated by ', ' optionally
Enclosed by ' "'
LINES terminated by ' \ n '
from table_name;

Resolve export CSV Chinese garbled problem:

CSV with TXT open, save As, select UTF8 encoding can be.

To resolve the import issue:

My.ini under the MySQL installation directory, add the following parameters:

[Client]
Default-character-set=utf8

[Mysqld]
Default-storage-engine=innodb
Character-set-server=utf8
Collation-server=utf8_general_ci

Restart the MySQL service.

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.