The LOAD DATA INFILE statement reads rows from a text file into a table at a very high speed.
This is used to mass data loading usually.

If you are in our shared hosting servers most probably you will not be able to run this comand.
Instead try using "LOAD DATA LOCAL".

The difference between the two commands is that without the LOCAL keyword the command requests the server to find the file and load data from it. With the LOCAL keyword, the MySQL client (your script, phpmyadmin, connecting from ssh, etc.) is what does the loading and then passes the data to MysSQL. As such, there is no special permissions needed for customers to do a "LOAD DATA LOCAL".

There are some alternatives to this:

LOAD DATA INFILE ALTERNATIVE FROM SSH:

$ echo "source databasefile.sql" | mysql -u user -ppassword dbasename

LOAD DATA OUTFILE ALTERNATIVE FROM SSH:

$ mysql -u user -ppassword dbasename > outputfile.sql

For further information please check the following link:

https://dev.mysql.com/doc/refman/5.5/en/load-data.html

Was this answer helpful? 0 Users Found This Useful (1 Votes)