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 \
# 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


5 Responses to MySQL Utilities mysqldbcopy

  1. DavidCartwright says:

    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. Cédric says:

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

    • OpenSorceDBA says:

      I checked with the development team and they assure me that mysqldbcopy does not use mysqldump to copy databases. And they use it to copy some large databases regularly.

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: