You are here: Re: backing up mysql question « All PHP « IT news, forums, messages
Re: backing up mysql question

Posted by Rik on 08/13/07 21:57

On Mon, 13 Aug 2007 23:55:06 +0200, <@gmail.com> wrote:
>> >> <?php
>>
>> >> $username =3D 'YOURUSERNAME';
>> >> $password =3D 'YOURPASSWORD';
>> >> $database =3D 'DATABASENAME';
>> >> $filename =3D 'FILENAME';
>>
>> >> system("mysqldump --compact --compress -u{$username} -p{$password}=

>>
>> >> > {$database} | gzip --best > {$filename}");
>>
>> >> ?>
>>
>> > I ran this,
>>
>> > <?php
>>
>> > $username =3D 'logg1';
>> > $password =3D 'something';
>> > $database =3D 'dbplace';
>> > $filename =3D 'testing.zip';
>>
>> > system("mysqldump --compact --compress -u{$username} -p{$password} =
>
>> > {$database} | gzip --best > {$filename}");
>>
>> > ?>
>>
>> > It placed a 'testing.zip' in the root folder, however it was only 2=
0
>> > bytes and nothing was in it. I know I have the other settings righ=
t
>> > as I use it successfully elsewhere. There were no displayed errors=

>> > after running it, ... is there anything I can do to de-bug? :) :)
>>
>> Give a FULL path to the file (like: /etc/path/to/file.zip). And enabl=
e
>> errors:
>> <?php
>> ini_set('display_errors',1);
>> error_reporting(E_ALL);
>> system();//etc
>> ?>
> Well, I used the full path and it totally didn't work with that. Since=

> it's placing something, or attempting to generate a zip file, I
> presume that path is fine the way I had it.
>
> Also, the error didn't help, I am getting an error on the error
> checking :))
>
> <?php
> ini_set('display_errors',1);
> error_reporting(E_ALL);
> system();//etc
> ?>
> Warning: Wrong parameter count for system() in /usr/home/domain/
> www.domain.com/www/backup.wave on line 19

The empty system() call is just an illustration. Just use the ini)sey() =
& =

error_reporting() before the actual system() call given earlier.

Be warned that it might very well be possible you can not access mysldum=
p.
-- =

Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация