dzogchen Posted November 21, 2003 Share Posted November 21, 2003 I have a rather large database that contains a few large tables and a large number of frequently changing very small tables i need to migrate to another server, and do it quickly so I minimize disrption of our site. mysqldump doesn\'t seem to take wildcards, so i wanted to write a php script to automate the execution of mysqldump. I can generate the table names and then i put them into a string something like: $dumpme = \"mysqldump --user=xxxx --password=xxxxx somedatabase $thistable > $thisdump n\"; and then use $file = exec(\"$dumpme\"); if (!$file) { echo \"Unable to dump file $thistable!<br> \"; }else{ echo \"dump of file $thisdump worked!<br>\"; } if I take the string generated by echo $dumpme; and run it in a terminal window, it works. If I run the php code, it fails. i have also tried it with : $file = exec($dumpme); and it still fails. also shell_exec and passthru Any ideas? I thought of using php for generating a long shell script, and running that from the command line. Any help appreciated Quote Link to comment https://forums.phpfreaks.com/topic/1406-problem-with-mysqldump-and-php/ 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.