March 14, 2011

Cloud Computing, Enterprise Cloud Technology < 1 min read

How To Solve Permissions Issues With LOAD DATA

With MySQL, loading a file is much more efficient than performing a long list of insert statements. If you're on a CPanel account, however, you may notice that you get error messages similar to the following when you try to load a file into MySQL.

ERROR 1045 (28000): Access denied for user 'username'@'%' (using password: YES)

Most probably you've already given that user all the possible permissions in CPanel's database wizard, but there's actually a file permission that isn't reflected in the list. If you are affected by this error message, then here's a simple fix. The statement that you are probably using looks like this:

LOAD DATA INFILE "bigTextFile.sql" INTO TABLE mytable;

Just change that by adding the "local" keyword, and your statement should now look like this:

LOAD DATA LOCAL INFILE "bigTextFile.sql" INTO TABLE mytable;

After that, you should no longer face those error messages!

CPanel offers a great way to streamline managing your server by offering you a simple, easy-to-use Graphical User Interface. Vodien offers web hosting with CPanel in-built, and backs it up with 24/7 SuperSupport.

[template id="7325"]

Skip to section