Jump to content

Inserting Data Into Mysql From File


Recommended Posts

I have a 700 meg file to insert into SQL. Rather than uploading it through PHP myadmin, I'd prefer to upload a zip of the file, unzip it and do a LOAD DATA command to mysql, however, when I do:

 

LOAD DATA INFILE "/home/everyli/aa.txt" INTO TABLE cities;

 

I get:

 

LOAD DATA INFILE "/home/everyli/aa.txt" INTO TABLE cities

MySQL said:

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

 

 

So what's up with that? Can I not load data from my account into my tables?

Link to comment
Share on other sites

WOW!!!

700 Mb of data? Now THAT'S a real database!! :blink: :)

 

As to your question, the MySQL "LOAD DATA INFILE" documentation has this:

For security reasons, when reading text files located on the server, the files must either reside in the database directory or be readable by all. Also, to use LOAD DATA INFILE on server files, you must have the FILE privilege on the server host.

 

I'm not sure if we have the FILE privilege. Also, are the permissions on the uploaded file set to be readable by all?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...