Mysql imports data from a csv file. Only the first line can be imported.

Source: Internet
Author: User

Mysql imports data from a csv file. Only the first line can be imported.

Use workbench to import csv data. Only the first row of data can be imported, that is, the row that marks the column name of each column.
But the problem is that at the end of each import, the system prompts that 500 records have been imported (500 records exist in this file). However, after refreshing the database, the table is opened, there is only the line mentioned above.

You may also find that in the field separator column of the import settings, the operating system can only select a semicolon, colon, and TAB. However, in csv, the field and field are separated by commas.

 

Therefore, we will mainly confirm the following two points:

(1) check what is your separator? That is, what are the separators supported by the system, comma or semicolon? Is the delimiter consistent with that of the csv file? Make sure they are consistent!
(2) Use the binary editor to open your CSV content and see what the line break is after each line ends? The line breaks generated by different operating systems are inconsistent. Ensure that the line breaks of the end are consistent with those of the operating system!

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.