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.

http://dev.mysql.com/doc/refman/5.0/en/loading-tables.html

ERROR 1148 (42000): The used command is not allowed with this MySQL version

  • If LOAD DATA LOCAL is 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

http://dev.mysql.com/doc/refman/5.0/en/load-data-local.html

Official MySQL.com is under documented in server setup on Mac OSX.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading LOAD DATA INFILE won’t work as it is at Web Builders.

meta

%d bloggers like this: