I\'m running Mysql 5.5 on Ubuntu 12 LTS. How should I enable LOAD DATA LOCAL INFILE in my.cnf?
I\'ve tried adding local-infile in my config at various places but I\'
Another way is to use the mysqlimport
client program.
You invoke it as follows:
mysqlimport -uTheUsername -pThePassword --local yourDatabaseName tableName.txt
This generates a LOAD DATA
statement which loads tableName.txt
into the tableName
table.
Keep in mind the following:
mysqlimport
determines the table name from the file you provide; using all text from the start of the file name up to the first period as the table name. So, if you wish to load several files to the same table you could distinguish them like tableName.1.txt
, tableName.2.txt
,..., etc, for example.