Tuesday, February 9, 2010

Getting a MySQL DB dump in local machine from server

Getting a DB dump in local machine from server..

Step1: Login into the server where mysql is hosted -
ssh username@server
Step 2: Take MySQL Dump
mysqldump dbname -u dbusername -p > filename.sql
Step 3: Logout
Logout of server
Step 4: from Local machine
scp username@server:server_path/filename.sql dumpfile.sql


The above steps can be done in 1 step.
mysqldump -h hostname -u dbusername -p dbname > filename.sql

No comments: