943,822 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 19659
  • MySQL RSS
Jul 18th, 2005
0

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

Expand Post »
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.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
michael123 is offline Offline
93 posts
since Jun 2005
Jul 19th, 2005
0

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

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mshavel@optonli is offline Offline
3 posts
since Jul 2005
Dec 13th, 2005
0

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

Quote 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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mysqlautobackup is offline Offline
1 posts
since Sep 2005
Jan 15th, 2006
0

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

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
Reputation Points: 10
Solved Threads: 2
Junior Poster
william_stam is offline Offline
131 posts
since Mar 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: update problem
Next Thread in MySQL Forum Timeline: Project getting started





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC