The usage is as follows:
Copy codeThe Code is as follows: mysql> load data local infile "D:/AB .txt" into table mytbl (name, age );
Using the preceding command, you can import the content of the D:/AB .txt file to mytbl. the nameand ageare the fields of mytbl, and correspond to the data in each row in the AB .txt file. If mysql is not specified during compilation and installation
-Enable-local-infile:
Copy codeThe Code is as follows: ERROR 1148 (42000): The used command is not allowed with this MySQL version
There are two solutions: one is to re-compile and install the above parameters, but directly run the command line, as shown below:
Copy codeThe Code is as follows: mysql-uroot-proot mydb_name -- local-infile = 1-e 'Load data local infile "D:/AB .txt" into table mytbl (name, age )'
I tested it. It took about three minutes to use the load data command to import 3 million data records!