You can graphically import data through the tool SQLyog.
1. Prepare Excel table
2. Import Excel tabular data into the MySQL database
(1) Open the prepared Excel table and choose save format as csv.
(2) If a Chinese character is present in the prepared Excel data table, the document character in the saved CSV format needs to be set to UTF-8. Otherwise the imported data is garbled.
(3) Open SQLyog, select the Import table to be imported. Right-click Import, select Import using locally loaded CSV data
(4) Set the fields that need to be canceled. And the escape character, field, and line termination.
The field terminates the general selection "," comma, because by default when Excel saves the CSV format, the fields are delimited by commas.
Line terminates the general selection \ n, which is the newline escape character: Line break (LF), moving the current position to the beginning of the next line.
Note: For example, the imported data above has the \ character, then the escape is \ \. It should also be set to \ \ In the imported data document (CSV). Otherwise the database is not recognized.
(5) Click the "Import" button when the above settings are complete and import.
By doing this, you will find it cumbersome and need to be provisioned again and again if there is a problem.
The following statement is equivalent to the above operation.
LOAD DATA LOCAL INFILE ' c:\\users\\administrator\\desktop\\test\\q.csv ' into TABLE ' m_test '. ' Sstest '
CHARACTER SET ' UTF8 ' fields escaped by ' \ \ ' TERMINATED by ', '
LINES TERMINATED by ' \ n ' (' name ', ' organization ', ' age ', ' date ')
Importing data through the tool SQLyog