How to: Transfer MySQL database from one server to another UNIX / Linux server
Q. I'm moving my server from local data center to another data center. I've new server up and running. My site is dynmic and I'd like to transfer MySQL database from old server to new server. How do I make transfer smooth and successful?
A. The best and secure way is to use ssh to transfer database to another server. You need to use following tools:
=> SSH client
=> SSH Server on remote box
=> mysqldump command
=> UNIX pipes
Let us say you would like to Transfer MySQL database called foo to remote box called bar, enter the following command at shell prompt:
$ mysqldump foo | ssh user@remote.box.bar.com mysql foo
You can just copy table called chocolate (from recipe database) to remote database called icecream using same syntax:
$ mysqldump recipe chocolate | ssh user@remote.box.com mysql icecream
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Linux / UNIX FAQ:
- MySQL empty database / delete all tables
- Mysql user creation - setting up a MySQL new user account
- MySQL command to show list of databases on server
- Create a mysql database, tables and insert data
- How can I restore a backup of a MySQL database?
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!
Tags: Linux, mysqldump_command, mysql_database, shell, ssh_client, ssh_server, transfer_database, UNIX ~ Last updated on: October 8, 2007



Recent Comments
Today ~ 17 Comments
Today ~ 2 Comments
Today ~ 37 Comments
Today ~ 46 Comments
Yesterday ~ 2 Comments