I needed to create a backup on my mysql database on remote host. I found out that there is a way that you can actually do that with mysqldump
. I didn’t believe that it will be so easy but i decided to give it a try. After all the stuff i read on the net about it there was’nt a single working example of it – so after some testing i managed to do it ![]()
so here it is:
first i will show you how to use mysqldump to backup your database on your harddrive on your local computer under windows. Go to your command prompt -> Start -> Run -> write “cmd” -> hit enter
go to your mysql bin directory, in case that you use xampp, and it’s installed on c:\xampp, it should be in c:\xampp\mysql\bin
you can do that by typing “cd \” and then “cd xampp\mysql\bin” (i’m trying to write this tutorial as simple as possible so that everybody will get it
)
after that, to backup your database on local mashine you should write:
mysqldump –add-drop-table -h localhost –user=root –password=yourpass yourDBname > OutputFile.sql
voilla
so if you want to backup your database to remote host the command gets a bit more sophisticated ![]()
here we go:
copy databse and it’s data from one server to another:
mysqldump –user=root –password=yourPassword –opt localDB | mysql -h 192.168.1.35 –user=root –password=remotePassword remoteDB
In our case we copy our local database “localDB” into the database “remoteDB” on the machine with 192.168.1.35
we can also do the command like this:
mysqldump -h 192.168.1.17 –user=test –password=12345 –opt remoteDB
| mysql -h 192.168.1.51 –user=root –password=bg_820918 remoteDB
in this case we copy the database “remoteDB” from remote host to another remote host in the database “remoteDB”
now you see how powerfull mysqldump really is, and that’s only few of the things it’s capable of ![]()
I hope this will was usefull for someone
July 20th, 2010 at 10:57 am
Great help! Im using Linux and it worked for me
July 20th, 2010 at 12:27 pm
10x Manal, i’m glad it worked for you
December 16th, 2011 at 8:17 am
Thank you for taking the time to publish this information very useful!I’m still waiting for some interesting thoughts from your side in your next post thanks.
December 17th, 2011 at 11:19 am
http://www.snow-coats.com/moncler comfort and ease. The elbow, shoulders, and complete backside of the arms have nylon
Supplex taslan overlay, which, in layman’s phrases give you optimum defense to your most
December 19th, 2011 at 2:45 am
Mostly all the Websites are for the information purpose and you have also created such a great website here.Such a great ideas you have Provided here.Thank you for sharing
December 21st, 2011 at 2:56 am
While Sherlock is of course a task of fiction, an speck of resolution is everlasting possible and is in sighting something that we do all the time unconsciously.
December 26th, 2011 at 10:44 am
Thank you for taking the time to publish this information very useful!I’m still waiting for some interesting thoughts from your side in your next post thanks.