1. copy the data in the excel table to the txt file. (If you have any Chinese characters, note: Change the txt file to the 8th type. 2. Add the txt file to the D disk. 3. Create a database and a table. (Note: the attribute in the database must be consistent with the number of columns in the excel table. 4. Execute the following code on mysql: LOADDATALOCALINFILED: cccccccc.txt I
1. copy the data in the excel table to the txt file (if there are Chinese characters, note: Change the txt file to UTF-8). 2. Add the. txt file to the D disk. 3. Create a database and a table (note: the attribute in the database must be consistent with the number of columns in the excel table. 4. Execute the following code on mysql: load data local infile 'd: \ cccccccc.txt 'I
1. copy the data in the excel file to the txt file (if there are Chinese characters, note: Change the txt file to UTF-8 format)
2. Add the. txt file to drive D.
3. Create a database and a table (note: the attribute in the database must be consistent with the number of columns in the excel table)
4. Run the following code on mysql: load data local infile 'd: \ cccccc.txt 'into TABLE book fields terminated by '\ t'
1) save the file in UTF-8 format (click to encode the file =)
Supplement: We usually encounter this situation =. I don't want to import all the data in the excel table, but just import one column (that is, an attribute in mysql) run the following statement:
Load data infile 'd: \ ccccccf.txt 'ignore into table pa_db_depart (NAME, STATE, LOGO );
Note: In an excel table, if the data is arranged as follows:
When I write an SQL statement, the attribute definition sequence is the same as the data sequence in the excel table. For example, here ("China South Network" corresponds to NAME) (food.southcn.com corresponds to STATE) ("commercial media" corresponds to the LOGO) in a word, it is best not to change the order in the excel table, we just need to change the attribute order of the SQL statement.