HeidiSQL import csv file problem solving (including time format processing)

There are two problems when importing data to HeidiSQL:
1. The csv file cannot be imported, and the error message: Data too long for column 'XXX' at row 1.
For example:
we created a table area_table, and the corresponding csv file import.
insert image description here
insert image description here
The import interface is as follows:
insert image description here
You will encounter the following error message:
insert image description here
The reason for the error is that the csv file is separated by commas, and the default separator in the import interface is a semicolon, so you need to change the semicolon to a comma.
insert image description here
Press the [Import] button to import successfully!
insert image description here
2. Regarding the time format, if the time format of the csv file is YYYY/M/D and you want to import it into YYYY-MM-DD, you need to modify the format of the CSV file, but you will find that after the modification , and when the file is opened again, it changes back to its original format.
For example:
the created data table is store_table, and the corresponding csv file salesdate column time format is YYYY/M/D.
insert image description here
insert image description here
Modify the time format of the salesdate column to restore the original because when the csv file is saved, the format you set will be removed, and the time format of the computer system will be the default, so you need to modify the time format of the **** computer .
1) Enter Control Panel -> Date and Time
insert image description here
2) Select to change the date and time
insert image description here
3) Click to change the date setting
insert image description here
4) Set the field after the date format short date to yyyy-mm-ddinsert image description here
5) Click OK to make the setting take effect That's it. Open the csv file again, the date format has changed. Just import the data.
insert image description here
insert image description here
A little problem to deal with, I hope it can help you!

**It is not easy to sort out the content. I think the content of the course is good when I pass by. Please help me to like and bookmark it! Thanks♪(・ω・)ノ****If you need to reprint, please indicate the source

Guess you like

Origin blog.csdn.net/zxxxlh123/article/details/113365925