Mysql cannot import csv data using SQLyog.

Source: Internet
Author: User

Mysql cannot import csv data using SQLyog.

The software used to import data to mysql today is SQLyog. I believe that you can directly import data to mysql. Select a table and select import-import to use local csv data, if you do not know what the import is unsuccessful, you can use the command to record it and use it for future reference:

(My windows OS)

Load data local infile 'C: \ Users \ zl \ Desktop \ zhishu.csv 'into table library name. table name character set gbk fields terminated by ', 'optionally enclosed by' "'elasticed BY '" 'Lines terminated by' \ r \ n' (id, 'name ', 'description', parent_id)

Note:

Files in 1.csv are generally encoded in gbk. Therefore, the encoding is set to gbk.
2. The field name is enclosed in brackets.


After SQLyog imports a CSV file, How can I fix Chinese Characters in mysql?

Is your database encoded like csv? The difference is garbled.

Garbled characters are displayed in Chinese when sqlyog imports csv files.

This is caused by inconsistent file encoding. Open the CSV file in notepad and select "Save as". There is an "encoding" next to the "save" button below ", select UTF-8 or mysql file encoding.

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.