Suppose the table has a (integer field), B (integer field), C (string data) Three columns of data, you want to import into the MySQL database in the table table,table the fields that need to be inserted are COL1,COL2,COL3
1. In any column, assuming in column D, enter: =concatenate ("INSERT into table (COL1,COL2,COL3) VALUES (", A2, ",", B2, ", '", C2, "');"), because A1,B1, C1 in Excel store the header well, the data is starting from the second line, and then pull the sum, the average formula to drop down the complete table,
2, press CTRL + C, directly copy this column to Notepad paste, get a lot of insert statement.
3, open the MySQL command line Client, is the MySQL comes with an operation interface, Instead of using MySQLQueryBrowser.exe graphical interface, because some of the lower version of the MySQLQueryBrowser.exe input SQL statement containing Chinese words will be garbled.
4, enter the password, login, and then enter the "use you want to manipulate the name of the database;" By pressing ENTER, the semicolon cannot be saved, because in MySQL Command line client, a semicolon is used to distinguish a single statement.
5, input "Set names your database code;", generally GBK or utf8,gb2312 also have, pay attention to Utf-8 code here to be expressed as UTF8, without this sentence, insert Chinese or will error.
6, copy Notepad that a lot of INSERT statements, right-click on the command line, paste, cannot use Ctrl + V, wait for a little bit of MySQL execution process, then import Excel to MySQL complete
Such a method can also be used with other SQL statements and database
"MySQL" Imports an Excel table into one of MySQL's tables