MySqldump creates empty file

I am trying to create a one click backup database script so non-geek
office staff can do backups, but so far I can only output empty files -
the new file appears, but it is empty....

E.G.
$db_user = "root";
$db_password = "";
$db_database = "or";
$db_server = "localhost";
$backup_path = "C:\\xampp\\htdocs\\openreal\\admin\\backup\\";
$path_to_mysqldump = "C:\\xampp\\mysql\\bin\\";
$filename = "backup".date("YmdHis").".sql";

shell_exec ("mysqldump $db_database > $path_to_mysqldump.$filename
--user=$db_user --password=$db_password");

I have tried various forms of this syntax with no content output?
Rhys [ Di, 22 August 2006 06:02 ] [ ID #1440043 ]

Re: MySqldump creates empty file

rhys [at] biznz.net wrote:
> I am trying to create a one click backup database script so non-geek
> office staff can do backups, but so far I can only output empty files -
> the new file appears, but it is empty....
>
> E.G.
> $db_user = "root";
> $db_password = "";
> $db_database = "or";
> $db_server = "localhost";
> $backup_path = "C:\\xampp\\htdocs\\openreal\\admin\\backup\\";
> $path_to_mysqldump = "C:\\xampp\\mysql\\bin\\";
> $filename = "backup".date("YmdHis").".sql";
>
> shell_exec ("mysqldump $db_database > $path_to_mysqldump.$filename
> --user=$db_user --password=$db_password");
>
> I have tried various forms of this syntax with no content output?

Don't think microsofts qdos supports stream redirections and I don't think you
want a dot as the first in the filename.

try

shell_exec ("mysqldump $db_database --result-file=$path_to_mysqldump$filename
--user=$db_user --password=$db_password");


//Aho
Shion [ Di, 22 August 2006 06:15 ] [ ID #1440044 ]

Re: MySqldump creates empty file

> Don't think microsofts qdos supports stream redirections and I don't think you
> want a dot as the first in the filename.

Thanks for the reply - What is qdos?

I am trying to do this with php code, but don't really know what I'm
doing............
This is to run under an existing php program
Rhys [ Di, 22 August 2006 06:31 ] [ ID #1440045 ]

Re: MySqldump creates empty file

J.O. Aho wrote:
> rhys [at] biznz.net wrote:
> > I am trying to create a one click backup database script so non-geek
> > office staff can do backups, but so far I can only output empty files -
> > the new file appears, but it is empty....
> >
> > E.G.
> > $db_user = "root";
> > $db_password = "";
> > $db_database = "or";
> > $db_server = "localhost";
> > $backup_path = "C:\\xampp\\htdocs\\openreal\\admin\\backup\\";
> > $path_to_mysqldump = "C:\\xampp\\mysql\\bin\\";
> > $filename = "backup".date("YmdHis").".sql";
> >
> > shell_exec ("mysqldump $db_database > $path_to_mysqldump.$filename
> > --user=$db_user --password=$db_password");
> >
> > I have tried various forms of this syntax with no content output?
>

...and IF that really is your password and/or directory tree, please
modify them!
> Don't think microsofts qdos supports stream redirections and I don't think you
> want a dot as the first in the filename.
>
> try
>
> shell_exec ("mysqldump $db_database --result-file=$path_to_mysqldump$filename
> --user=$db_user --password=$db_password");
>
>
> //Aho
zac.carey [ Di, 22 August 2006 10:04 ] [ ID #1440046 ]

Re: MySqldump creates empty file

rhys [at] biznz.net wrote:
>> Don't think microsofts qdos supports stream redirections and I don't think you
>> want a dot as the first in the filename.
>
> Thanks for the reply - What is qdos?

'Quick and Dirty Operating System' (qdos) is what MS-Dos is.


//Aho
Shion [ Di, 22 August 2006 15:57 ] [ ID #1440047 ]

Re: MySqldump creates empty file

OK - solved that. This works"-

$fish= "$path_to_mysqldump\\mysqldump.exe --u $db_user
--ignore-table=$db.$config $db > $filename ";
exec($fish);
Rhys [ Mi, 23 August 2006 12:51 ] [ ID #1441768 ]
PHP » alt.php.sql » MySqldump creates empty file

Vorheriges Thema: PHP(myadmin) and "long" MySQL passwords
Nächstes Thema: What is a DataSource(Connecting to MySqL)?