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

Posted by anonymous on 08/13/07 22:01

On Aug 13, 4:43 pm, Rik <luiheidsgoe...@hotmail.com> wrote:
> On Mon, 13 Aug 2007 23:40:33 +0200, <rebecca...@gmail.com> wrote:
> > Hi,
> >> <?php
>
> >> $username = 'YOURUSERNAME';
> >> $password = 'YOURPASSWORD';
> >> $database = 'DATABASENAME';
> >> $filename = 'FILENAME';
>
> >> system("mysqldump --compact --compress -u{$username} -p{$password}
>
> >> > {$database} | gzip --best > {$filename}");
>
> >> ?>
>
> > I ran this,
>
> > <?php
>
> > $username = 'logg1';
> > $password = 'something';
> > $database = 'dbplace';
> > $filename = '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 20
> > bytes and nothing was in it. I know I have the other settings right
> > 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 enable
> errors:
> <?php
> ini_set('display_errors',1);
> error_reporting(E_ALL);
> system();//etc
> ?>
>
> --
> Rik Wasmus

Hi Rik! Changing the path to a path I know is correct, didn't really
help and actually didn't generate anything. Since it's generating
a .zip file as is, that proves at least it's trying to do something.

<?php

ini_set('display_errors',1);
error_reporting(E_ALL);

$username = ' ';
$password = ' ';
$database = ' ';
$filename = 'testing.zip';

system("mysqldump --compact --compress -u{$username} -p{$password} >
{$database} | gzip --best > {$filename}");

?>

Is this the correct implementation of error checking? Even if I run
the above code like it is, after taking out the username/password/
database, ... it doesn't print any messages.

jdbartlett, maybe you can run this code and see if it does the same
thing for you, or maybe its just my syntax :)

 

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

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