ClyssaN Posted April 18, 2007 Share Posted April 18, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/47582-mysqlimport-and-load-data-file/ Share on other sites More sharing options...
bubblegum.anarchy Posted April 18, 2007 Share Posted April 18, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/47582-mysqlimport-and-load-data-file/#findComment-232657 Share on other sites More sharing options...
ClyssaN Posted April 18, 2007 Author Share Posted April 18, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/47582-mysqlimport-and-load-data-file/#findComment-232668 Share on other sites More sharing options...
fenway Posted April 20, 2007 Share Posted April 20, 2007 Not really... you need to "run" these sql commands. Quote Link to comment https://forums.phpfreaks.com/topic/47582-mysqlimport-and-load-data-file/#findComment-233952 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.