Hi,

I use a Linux, shared hosting setup on GoDaddy. I am trying to bulk load a text file into an existing table using the LOAD DATA INFILE command. Everything works great on my development platform but when I run the script at GoDaddy, I get the error: "Access denied for user.'username@%' (Using password: YES)". I've called GoDaddy support 😕 several times and they haven't been able to help me.

The abbreviated version of my code is as follows:

<?php
  require_once('include/conn.php') ; // db connection settings
 ?>
<?php

// Open the database connection
mysql_select_db($db, $db_instance);

$sqlstr = "LOAD DATA INFILE 'industry.txt'
			INTO TABLE industry 
		( 	NAICS_CODE,
			NAICS_DESC,
			NAICS_DISP ); " ;

$rs = mysql_query($sqlstr, $db_instance) or die(mysql_error());

?>

The source text file is in the same directory as my php script. My database connection works fine for all other commands (i.e., insert, update, select).

Any pointers would be GREATLY appreciated!!!!

Thanks,

Nathan

    Are you sure that the user has permissions to create or load data? If not, there's your issue.

    Seems like it's a permissions setting from within your GoDaddy hosting account, you can either give that user "all" priveleges, or just a few. It's up to you. I'm not familiar with their CP, so I can't navigate it for you.

      Thanks for the feedback...

      User permission would appear to be the logical explanation. However, I don't know of a way to change my permissions. GoDaddy support 😕 told me the permissions were fixed in a shared environment. They also told me the command I was trying to run (load data infile) was permissible. But that was the extent of :quiet: the support.

      I'm going to keep researching but may need to quack a lengthy "insert into" script to get around the import challenges.

      Thanks again,

      Nathan

        Hmm... I'd suggest moving away from goDaddy if at all possible. Their forte is domains, not hosting. IF they can't help you, move away. I only say that because it's a headache when you can't control everything about your site.

        It is a permissions thing, and if you can't manually change permissions, try using phpMyAdmin to actually do it. It's an option....

          Thanks Brett. Last night I was actually able to change directory permissions for those directories that I created. However, I'm not able to even see the mysql directories. And the phpMyAdmin utility that comes with the account is quite limited.

          So...to be part of the solution rather than the problem...I'm going to take your advice. GoDaddy does offer a dedicated server model that I believe provides you with complete control. Although I've often had mixed :eek: results with their support, I'm very please with their hosting performance, stability and price. I'll also research some other providers.

          To keep things moving I'm also going to quack up my own .csv to "insert into" solution. Have to get the data in somehow today. I believe there are some products out there. I'll close the thread with the ulitmate solution.

          Thanks for your help.

          Nathan

            Just putting this issue to bed. The issue was indeed permission related - I did not have FILE privilege for the admin account; nor could I get the permission set with the hosting plan I was using.

            Long story short, I changed to a virtual dedicated server and now have all the permissions needed. Importing data using the LOAD DATA INFILE command works fine.

              Write a Reply...