Skip to content
notxarb edited this page Sep 14, 2010 · 2 revisions

There are two methods of using mysql-quick-clone.pl:

  1. command line options
  2. configuration file

This information can be retrieved from the man pages:

  1. man mysql-quick-clone.pl
  2. man mysql-quick-clone.conf

Command Line Options

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 ...]

--sh=sourceHost

This sets the ip/name of the host of the source of the copy.

--sp=sourcePort

This sets the port of source of the copy.

--sd=sourceDatabase

This sets the name of the source database.

--su=sourceUser

This sets the user for the source database.

--spw=sourcePassword

This sets the password for the source database user.

--dh=destHost

This sets the ip/name of the host of the destination of the copy.

--dp=destPort

This sets the port of destination of the copy.

--dd=destDatabase

This sets the name of the destination database.

--du=destUser

This sets the user for the destination database.

--dpw=destPassword

This sets the password for the destination database user.

--dir=dir

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.

--all

This is an optional option that will copy all the tables from the source database to the destination.

--new

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.

--5

Use this if the mysql commands have a suffix of 5 on them (mysql5, msqldump5…).

tables ...

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.

Configuration File

mysql-quick-clone.pl --c=config.conf

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