Forum Moderators: coopster

Message Too Old, No Replies

Mysqldump creating empty file

apache php vserver

         

mokuril

1:53 pm on Jul 17, 2008 (gmt 0)

10+ Year Member



I'm trying to write a script in php to write a backup file of my mysql-databases.
The problem is I keep getting an empty file.

Now I think I know what causes the problem, but I'm still missing out on how I can solve this problem.

My apache webserver is a vserver, so is my mysql database. So when I login to my www-vserver, the mysqldump command does not work.

Of course, when I'm logged in on my www-vserver, I can't enter my sql-vserver, whitout leaving the www-vserver...

Does this mean I can't issue a mysqldump command through a php script, like shell_exec("mysqldump ..."), because the webserver is 'trapped' inside a vserver?

eelixduppy

4:51 pm on Jul 17, 2008 (gmt 0)



I guess it would depend on how the server was setup; if done correctly I don't see why you couldn't use mysqldump. If you still cannot get it to work then if it's only a few tables you want to backup you can SELECT * INTO OUTFILE each table you want to backup, but this could be tedious. Keep trying; you might also need to use the full path to mysqldump, too.

mokuril

2:48 pm on Jul 18, 2008 (gmt 0)

10+ Year Member



I've written a few 'select from' queries to produce an ordinary file.

The "select into outfile" statement doesn't work either. Only from commandline when entering that specific vserver.

Thanks for your reply though!