Wednesday, August 22, 2012

MySQL Utilities mysqldbcopy

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.



PlanetMySQL Voting:
Vote UP /
Vote DOWN

DIGITAL JUICE

No comments:

Post a Comment

Thank's!