Skip to content

Instantly share code, notes, and snippets.

@kolunar
Created April 24, 2017 22:57
Show Gist options
  • Save kolunar/f07aa6ac2752640db1efe0f619889220 to your computer and use it in GitHub Desktop.
Save kolunar/f07aa6ac2752640db1efe0f619889220 to your computer and use it in GitHub Desktop.
MySQL Cloning the database using mysql-utilities' mysqldbcopy
mysqldbcopy is part of mysql-utilities.
apt-get install mysql-utilities (if not yet installed)
Usage: mysqldbcopy --source=user:pass@host:port:socket --destination=user:pass@host:port:socket orig_db:new_db
Example:
mysqldbcopy --source=user_name:password@localhost:3306 --destination=user_name:password@localhost:3306 mddb:mddb_demo
Working Example:
su root;
mysqldbcopy --source=root@localhost:3306 --destination=root@localhost:3306 yddb:yddb_bk
su root;
mysqldbcopy --source=joomla_user:df*********s@localhost:3306 --destination=joomla_user:df*********s@localhost:3306 mddb:mddb_bk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment