Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load data infile error

Status
Not open for further replies.

UKmichael

Programmer
Mar 29, 2004
13
GB
When I enter 'LOAD DATA INFILE 'imptest.txt' INTO TABLE imptest' directly into phpmyadmin I get the following error

Access denied for user: 'me@localhost' (Using password: YES)

Yet when I use the following php code, it opens the same file without any problem.

$url = '../../imptest.txt';
$fp = fopen ($url, 'r') or die ('Cannot access file.');

I am new to mysql and don't understand why I'm getting an access denied error. Do you normally have to supply a password with 'load data infile'? If so, how?

I am using a remote server running version 3.23.49.

Thanks
 
The error message is nothing to do with opening the file; it is a database access issue. It looks like the user you connected as does not have the INSERT and/or FILE privileges. Try connecting as 'root'.
 
Thanks for the response. I am now reading up on the art of database privilages.
 
Having read the documentation I agree that it sounds like a file privilage problem. If I am using my ISP's server, can I change my own privilages or do I have to get them to do it for me? I have tried this using the following

grant all on *.* to user@host identified by 'password'

but got an access denied error.

Can I use a command through phpmyadmin that will display my current privilages? Tried this as well without success. This is all new to me and although I understand the principle I have not got the relevant experience to feel confident about what I am doing. Hope you can help.
 
To execute a GRANT statement, you need to have the GRANT privilege yourself, but this would normally only be available to the root user. Did you connect as the root user? If you haven't got a root username and password, then you would have to contact your ISP for them. You could then issue SELECT * FROM mysql.user to list all the users and their global privileges, and SHOW GRANTS FOR user@host to show all privileges for each user.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top