Copy database to another database through command

1. Copy One database to other on same host

mysqldump -uroot -p source_database_name | mysql -uroot dest_database_name

2. Copy database from one host to other host.

mysqldump -uroot -p source_database | ssh host2 “mysql -uroot dest_database”


Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.