LOAD DATA INFILE won’t work as it is
November 14, 2009 § Leave a comment
LOAD DATA LOCAL INFILE won’t work if you start mysql as it is. In order to enable local-infile=1 into my.cnf, you would have to consider re-installing that requires a lot of work.
The standard configuration for shared and dedicated hosting today with the Plesk server administration system sets “set-variable=local-infile=0” in “/etc/my.cnf”. Thus, LOAD DATA LOCAL is disabled on such servers.
# Log into mysql using root
mysql -u root -p
Enter password: (skip password as blank)
# Select existing database named “sample”
mysql> USE sample;
mysql> LOAD DATA LOCAL INFILE ‘/Users/<Username>/database/company.txt’ INTO TABLE company (name, title, company);
If the statement fails, it is likely that your MySQL installation does not have local file capability enabled by default. See Section 5.3.4, “Security Issues with
LOAD DATA LOCAL”, for information on how to change this.
ERROR 1148 (42000): The used command is not allowed with this MySQL version
LOAD DATA LOCALis disabled, either in the server or the client, a client that attempts to issue such a statement receives the following error message:
ERROR 1148: The used command is not allowed with this MySQL version
Official MySQL.com is under documented in server setup on Mac OSX.