PDA

View Full Version : Script Wanted


16f877
Fri 7th Jun '02, 1:35pm
A PHP Script to execute this command


mysql -uUSERNAME -p newdbname < /path/to/dump.sql

Mark Hensler
Fri 7th Jun '02, 1:50pm
If you need to execute it only once. Use SSH (http://www.ssh.com), or if you don't have a SSH account, use Telnet.

If you need this to run every X, then throw that into a cron job.

Dan615
Fri 7th Jun '02, 10:39pm
you can put it in PHP using


<? exec("mysql -uUSERNAME -p newdbname < /path/to/dump.sql"); ?>

Steve Machol
Sat 8th Jun '02, 1:37am
The problem is that any PHP script will suffer the same disadvantage as the backup option in the Admin CP - namely it is subject to PHP timeout issues. As I've explained before the only reliable method for backing up is with shell access via telnet/ssh. Any script will be inherently unreliable.

16f877
Sat 8th Jun '02, 5:39am
Thanx for all the help,,

In the end I managed to get the host to import the database.

But I also found that I could access the MYSQL Database remotely, so wont have any problems in future!