GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 10-Aug-2004, 23:05
rose rose is offline
New Member
 
Join Date: Jul 2004
Posts: 5
rose is on a distinguished road
Question

export mysqldatabase


is it possible to export mysqldatabase using php ie(using phpcode access the mysqlserver zip the database & send it to the server)?if yes how


thanks in advance
  #2  
Old 11-Aug-2004, 04:28
Garth Farley Garth Farley is offline
Invalid Email Address
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
Well it can be done on the Unix command line simply by:

mysqldump -uUsername -pPassword dbname -c | gzip > dbname.gz

This command connects to mysql using your Username/Password, selects the database 'dbname', dumps everything there into a gzipped file called dbname.gz The -c switch means it writes full INSERT querys including the names of the columns.

Then using PHP (if you wish), you can call run this command using the system() call.
GF
  #3  
Old 11-Aug-2004, 10:01
tubedogg tubedogg is offline
New Member
 
Join Date: Aug 2004
Posts: 11
tubedogg will become famous soon enough
Keep in mind that depending on the size of your database, and the amount of time that PHP scripts on your server have to run, you may get a partial or corrupted backup. The only truly safe way to make a backup of your database is by running the command that Garth gave directly from the command line (via Telnet/SSH).
 
 

Recent GIDBlogPython ebook by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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 Off
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 05:37.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.