Tuesday, February 9, 2010

Getting a DB dump in local machine from server

Getting a DB dump in local machine from server..

1. Login into the server - ssh
username@server
2. mysqldump dbname -u dbusername -p > filename.sql
3. Logout of server

set path in local machine: Example - /home/Desktop

4. scp username@server:server_path/filename.sql
dumpfile.sql

Thts it, now db dump is in local machine Desktop

Getting dump to local db,

mysql -u root -p
password: root
mysql> create database dbname
exit
mysql -u user -p dbname <
dumpfile.sql


No comments: