Jump to content

Mysqlimport and LOAD DATA FILE


ClyssaN

Recommended Posts

Hello,

 

Heres my situation:

 

I have a php script that executes the exec command to make a mysqldump of a given database to a file:

 

mysqldump -uroot -p12345 --add-drop-table -Q mydatabase --result-file=dumpfile.sql

 

To restore the database i use:

 

mysql -uroot -p12345 mydatabase < dumpfile.sql

 

This works very well because i want to make a full backup from my webpage and then restore it if necessary.

 

Now the problem is this, i had to move my site to a new server, and the new server runs php in safe mode, so i'm able to run the mysqldump but i'm not able to run the mysql < dumpfile because the "<" is not permited... dont know why...

 

Is there a way to use the LOAD DATA INFILE to import the file generated by mysqldump? The dumpfile.sql deletes and creates the tables

 

I tried the LOAD DATA INFILE but with no success, i have no experience with this command.

 

 

So to resume, is it possible to import a full database with the LOAD DATA FILE command from a mysqldump file, all done via webpage?

 

Thank in advance.

 

Link to comment
Share on other sites

Now the problem is this, i had to move my site to a new server, and the new server runs php in safe mode, so i'm able to run the mysqldump but i'm not able to run the mysql < dumpfile because the "<" is not permited... dont know why...

I thought `<` is a linux piping command, nothing to do with php - contact your server admin.

Link to comment
Share on other sites

Now the problem is this, i had to move my site to a new server, and the new server runs php in safe mode, so i'm able to run the mysqldump but i'm not able to run the mysql < dumpfile because the "<" is not permited... dont know why...

I thought `<` is a linux piping command, nothing to do with php - contact your server admin.

 

Yes, you right, it's a linux thing, but i'm not allowed to use the mysql -u -p database < dumpfile (dont know why ...), so i ask if there is a away to use the LOAD DATA with the same affect (using the dumpfile generated by mysqldump).

 

Until now i cannot find a way...

 

Any help you be very appreciated

 

Thank you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.