-
Notifications
You must be signed in to change notification settings - Fork 4
Usage
There are two methods of using mysql-quick-clone.pl:
- command line options
- configuration file
This information can be retrieved from the man pages:
- man mysql-quick-clone.pl
- man mysql-quick-clone.conf
mysql-quick-clone.pl --sh=sourceHost --sp=sourcePort --sd=sourceDatabase --su=sourceUser --spw=sourcePassword --dh=destHost --dp=destPort --dd=destDatabase --du=destUser --dpw=destPassword --sitedir=dir [--all] [--new] [--5] [tables ...]
This sets the ip/name of the host of the source of the copy.
This sets the port of source of the copy.
This sets the name of the source database.
This sets the user for the source database.
This sets the password for the source database user.
This sets the ip/name of the host of the destination of the copy.
This sets the port of destination of the copy.
This sets the name of the destination database.
This sets the user for the destination database.
This sets the password for the destination database user.
This sets the directory to save files that contain the dumped database content. This file must be accessible to both the source and destination servers.
This is an optional option that will copy all the tables from the source database to the destination.
This is an optional option that will copy the table structure when they do not already exist. Use this if and only if the tables do not exist in the destination database.
Use this if the mysql commands have a suffix of 5 on them (mysql5, msqldump5…).
This is a list of the names of the tables that are to be copied. Anything that is not recognized as a previous option will be interpreted as a table.
mysql-quick-clone.pl --c=config.conf
The configuration file holds values for all the settings above.
mysql-quick-clone.conf file that was copied is a template for created other configuration files.
The structure of the file is as follows:
[general]
all=0
Set this to ‘1’ to enable copying all tables
new=0
Set this to ‘1’ to enable creating a new copy.
dir=
Set this to a shared directory.
[source]
host=
Set this to the name/ip of the source database server.
port=
Set this to the MySQL port on the source server.
database=
Set this to the database name on the source server.
user=
Set this to the user name on the source server.
password=
Set this to the password of the user on the source server.
[destination]
host=
Set this to the name/ip of the destination database server.
port=
Set this to the MySQL port on the destination server.
database=
Set this to the database name on the destination server.
user=
Set this to the user name on the destination server.
password=
Set this to the password of the user on the source server.
[tables]
tables=<<EOT
Table names should be placed between this line and the ‘EOT’ on the last line.
EOT