TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-07-2007, 05:20 PM   #1 (permalink)
The Wanderer
Newcomer 
 
datahound's Avatar
 
Join Date: Dec 2007
Posts: 9
Thanks: 2
datahound is on a distinguished road
Default 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.
datahound is offline  
Reply With Quote
Old 12-07-2007, 09:20 PM   #2 (permalink)
The Wanderer
Newcomer 
 
Join Date: Dec 2007
Posts: 13
Thanks: 2
devolio is on a distinguished road
Default

I use this class to dump MySQL dbs.
devolio is offline  
Reply With Quote
The Following User Says Thank You to devolio For This Useful Post:
datahound (12-07-2007)
Old 12-07-2007, 10:39 PM   #3 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

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.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
The Following User Says Thank You to Wildhoney For This Useful Post:
datahound (12-08-2007)
Old 12-07-2007, 10:39 PM   #4 (permalink)
The Wanderer
Newcomer 
 
datahound's Avatar
 
Join Date: Dec 2007
Posts: 9
Thanks: 2
datahound is on a distinguished road
Default

Thanks devolio, that looks just the job.
datahound is offline  
Reply With Quote
Old 12-07-2007, 10:41 PM   #5 (permalink)
The Wanderer
Newcomer 
 
datahound's Avatar
 
Join Date: Dec 2007
Posts: 9
Thanks: 2
datahound is on a distinguished road
Default

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

I will look at these options though for future ref.
datahound is offline  
Reply With Quote
Old 12-08-2007, 12:18 AM   #6 (permalink)
The Wanderer
Newcomer 
 
datahound's Avatar
 
Join Date: Dec 2007
Posts: 9
Thanks: 2
datahound is on a distinguished road
Default

Quote:
Originally Posted by Wildhoney View Post
MySQL document on mysqlhotcopy is right here.
Thanks I will have a good read through this.
datahound is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 07:41 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design