Re: [PHP] One Button DB backup
- Date: Wed, 23 Nov 2016 15:01:03 +0000
- From: Bastien Koert <phpster@xxxxxxxxx>
- Subject: Re: [PHP] One Button DB backup
The one thing to watch is the table types. If there are InnoDb tables, they
need to be handled differently than the MyIsam. There are changes in the
command that need to be there to better handle the grabbing of the snapshot
of the db
- For InnoDB tables, you should use the --single-transaction option
- For MyISAM there is --lock-tables.
On Mon, Nov 7, 2016 at 9:16 AM Christoph M. Becker <cmbecker69@xxxxxx>
> On 06.11.2016 at 13:51, Paul M Foster wrote:
> > On Sun, Nov 06, 2016 at 10:00:33AM +0000, Chris Green wrote:
> >> Paul M Foster <paulf@xxxxxxxxxxxxxxxxx> wrote:
> >>> On Fri, Nov 04, 2016 at 01:14:37PM -0400, Tedd Sperling wrote:
> >>>> 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.
> > I use it in circumstances where I can control access. SQLite isn't one I
> > would normally recommend for multi-user access. But it's used quite
> > successfully by programs like Firefox.
> Note that SQLite3 has a backup API which is not yet supported by the
> PHP bindings, though. There is already a respective feature request for
>  <http://sqlite.org/backup.html>
>  <https://bugs.php.net/bug.php?id=70950>
> Christoph M. Becker
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php