User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 427,179 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,266 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 11731 | Replies: 3
Reply
Join Date: Jun 2005
Posts: 85
Reputation: michael123 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
michael123 michael123 is offline Offline
Junior Poster in Training

how to backup mysql DB to local machine? and restore?

  #1  
Jul 18th, 2005
I would like to know how I can backup Mysql tables from hosting server to my local pc? I don't want to use phpMyAdmin, is there some simple commands to do that(I use PHP)? and how to restore it back to hosting server?
I assume it will use csv file.

Any help will be appreciated.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2005
Posts: 3
Reputation: mshavel@optonli is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
mshavel@optonli mshavel@optonli is offline Offline
Newbie Poster

Re: how to backup mysql DB to local machine? and restore?

  #2  
Jul 19th, 2005
Hi
I use mysqlhotcopy; it runs from the command line. I don't remember if it comes default with MySql, it may not. But if not, It's easy to find on the web and install.
After you run it, you can tar up the directory it creates and ftp over to your local machine.
Putting it back on your server is a little more tricky. You'd have to stop the DB. Send the file over to the server. Decompress/untar it. Make sure the permissions are correct on all files (they should be). And then start up the DB again.
By the way, My server is a linux box. I'm not sure if mysqlhotcopy is available for Windows/Mac servers.

Mike
Reply With Quote  
Join Date: Sep 2005
Posts: 1
Reputation: mysqlautobackup is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
mysqlautobackup's Avatar
mysqlautobackup mysqlautobackup is offline Offline
Newbie Poster

Solution Re: how to backup mysql DB to local machine? and restore?

  #3  
Dec 13th, 2005
Originally Posted by michael123
I would like to know how I can backup Mysql tables from hosting server to my local pc? I don't want to use phpMyAdmin, is there some simple commands to do that(I use PHP)? and how to restore it back to hosting server?
I assume it will use csv file.

Any help will be appreciated.

Please free download MySQL Auto Backup at http://www.mysqlautobackup.com to help you to backup your MySQL databases automatically.
Reply With Quote  
Join Date: Mar 2005
Location: LTT, South Africa
Posts: 125
Reputation: william_stam is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
william_stam's Avatar
william_stam william_stam is offline Offline
Junior Poster

Re: how to backup mysql DB to local machine? and restore?

  #4  
Jan 15th, 2006
you will need to have the database servers ip or dns name

mysqldump --opt databasename > path_and_filname.sql

or from your cmd prompt

mysqldump -h hostserver -u username -ppasword --opt databasename > path_and_filname.sql

restoring it is the above with the > changed to < if im not mistaken
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 9:43 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC