TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   MySQL & Databases (http://www.talkphp.com/mysql-databases/)
-   -   Export as SQL from mySQL using cron job (http://www.talkphp.com/mysql-databases/1659-export-sql-mysql-using-cron-job.html)

datahound 12-07-2007 05:20 PM

Export as SQL from mySQL using cron job
 
I have a group of databases I would like to backup regularly and send the sql backup as an email to the site owner.

The cron job I can set up. The email part I can do.

But does anyone know a simple way to ask a db in mysql to dump itself in a standard sql export format including db structure and records?

Thanks.

devolio 12-07-2007 09:20 PM

I use this class to dump MySQL dbs.

Wildhoney 12-07-2007 10:39 PM

Nothing is straightforward, is it? You can execute the mysqlhotcopy command from the command line - although your user will need permission to use the exec() command from within PHP.

MySQL document on mysqlhotcopy is right here.

datahound 12-07-2007 10:39 PM

Thanks devolio, that looks just the job.

datahound 12-07-2007 10:41 PM

I have actually written a table dump now, no patience.

I will look at these options though for future ref.

datahound 12-08-2007 12:18 AM

Quote:

Originally Posted by Wildhoney (Post 5840)
MySQL document on mysqlhotcopy is right here.

Thanks I will have a good read through this.


All times are GMT. The time now is 08:21 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0