MySQL Utilities mysqldbcopy


The MySQL Utilities that come with Workbench can make short work of some important tasks. Back before MySQL 4, I used to have to regualrly create a copy of a production database by using a script that used mysqldump to save the database, create the new database, and feed in the data from the dump. It was not pretty but it worked reasonable well. But I longed for a more universal, one step process to do this work. And now we have mysqldbcopy.


$mysqldbcopy \
--source=root:xxxx@localhost:3306:/var/run/mysqld/mysqld.sock \ 
--destination=root:xxxx@localhost:3306:/var/run/mysqld/mysqld.sock \
world:world_copy
# Source on localhost: ... connected.
# Destination on localhost: ... connected.
# Copying database world renamed as world_copy
# Copying TABLE world.City
# Copying TABLE world.Country
# Copying TABLE world.CountryLanguage
# Copying data for TABLE world.City
# Copying data for TABLE world.Country
# Copying data for TABLE world.CountryLanguage
#...done.

About these ads

5 Comments

Filed under Basics, MySQL

5 responses to “MySQL Utilities mysqldbcopy

  1. DavidCartwright

    I am looking to test MySQL with SSL support. If I have understood correctly, you can then connect with both unencrypted and encrypted connections to the same port.

    Since I would want to force mysqldbcopy to transfer over a WAN SSL link, wondering how I can force it to use SSL since the help doesn’t list an SSL option?

  2. I understand that mysqldbcopy uses mysqldump to copy the databases.
    If I’m right, the tool is not really suitable for large databases.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s