Re: One Button DB backup
| From: | Nguyễn Hoàng Lân | Date: | Sun, 06 Nov 2016 10:45:48 +0000 |
| Subject: | Re: One Button DB backup | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-325821@lists.php.net to get a copy of this message | ||
$dumpSql = "mysqldump -u" . $dbUser . " -h" . $dbHost . " -p" .
$dbPass . "
--single-transaction " . $dbName . " | gzip > " . $dbBackupDir . "/" .
$backupName;
exec($dumpSql);
This is in a script which I'm running, I think it works?
2016-11-06 17:00 GMT+07:00 Chris Green <cl@isbd.net>:
> Paul M Foster <paulf@quillandmouse.com> wrote:
> > On Fri, Nov 04, 2016 at 01:14:37PM -0400, Tedd Sperling wrote:
> >
> > > Hi gang:
> > >
> > > I am in need of a one-button backup of a database via a php script
> > >
> > > Anyone have any suggestions, comments, code?
> > >
> >
> > What I like about SQLite is that it's generally a single file which can
> > be copied out. As I recall, MySQL has a cluster of files which can be
> > done the same way, if you can find which directory they reside in.
> > PostgreSQL is a lost cause. The files are all in one place, but the
> > names are weird.
> >
> You can't do that if the database is in use, you might well end up
> with a corrupt database.
>
> --
> Chris Green
> ·
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>