Copy database to a new server using ssh
Dump MYSQL in old server
mysqldump namebd -u userdb -p > name_db.sql
Copy a new server from old
rsync -avz -e ssh --progress /var/lib/mysql/namedb.sql root@IPServer:/var/lib/mysql
Create Database in new server
mysqladmin -u userdb -p create namedb
Import a database in new server
mysql namedb -u userdb -p < name_db.sql
/var/lib/mysql : directory mysql in debian
Written by Fabian Delgado
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#