Title: \fBmysqlserverclone\fR Author: [FIXME: author] [see http://docbook.sf.net/el/author] Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> Date: 08/01/2016 Manual: MySQL Utilities Source: MySQL 1.6.3 Language: English
mysqlserverclone - Clone Existing Server to Create New Server
This utility enables you to clone an existing MySQL server instance to create a new server instance on the same host. The utility creates a new datadir (--new-data), and, on Unix systems, starts the server with a socket file. You can optionally add a password for the login user account on the new instance.
If the user does not have read and write access to the folder specified by the --new-data option, the utility will issue an error.
Similarly, if the folder specified by
--new-data exists and is not empty, the utility will not delete the folder and will issue an error message. Users must specify the --delete-data option to permit the utility to remove the folder prior to starting the cloned server.
The utility does not copy any data. It merely creates a new running instance of the cloned server with the same options (or additional options if specified). Thus, to create a copy of a server, you must copy the data after the server is cloned. OPTIONS.PP mysqlserverclone accepts the following command-line options:
Display a help message and exit.
Display license information and exit.
Delete the folder specified by --new-data if it exists and is not empty.
The base directory for the MySQL server source, as an alternative to the --server option.
shell> mysqlserverclone --basedir=/source/mysql-5.6 \
--new-data=/source/temp_3007 --new-port=3007 --new-id=101 \
--root=root --mysqld="--log-bin --gtid-mode=on --log-slave-updates \
--enforce-gtid-consistency --master-info-repository=table \
--report-host=localhost --report-port=3007" --delete
Ignore the maximum path length and the low space checks for the --new-data option.
Additional options for mysqld. To specify multiple options, separate them by spaces. Use appropriate quoting as necessary. For example, to specify --log-bin=binlog and --general-log-file="mylogfile", use:
If the option --skip-innodb is included when connecting to a MySQL server version 5.7.5 or higher, the option is ignored and a warning is issued.
--mysqld="--log-bin=binlog --general-log-file='my log file'"
The full path to the location of the data directory for the new instance. The path size must be 200 characters or less and it requires at least 120 MB of free space.
The server_id value for the new server instance. The default is 2.
The port number for the new server instance. The default is 3307.
o --quiet, -q
Turn off all messages for quiet execution.
The password for the root user of the new server instance.
Connection information for the server to be cloned.
To connect to a server, it is necessary to specify connection parameters such as the user name, host name, password, and either a port or socket. MySQL Utilities provides a number of ways to supply this information. All of the methods require specifying your choice via a command-line option such as --server, --master, --slave, etc. The methods include the following in order of most secure to least secure.
o Use login-paths from your .mylogin.cnf file (encrypted, not visible). Example :
o Use a configuration file (unencrypted, not visible) Note: available in release-1.5.0. Example :
o Specify the data on the command-line (unencrypted, visible). Example :
The path to a file that contains a list of trusted SSL CAs.
The name of the SSL certificate file to use for establishing a secure connection.
The name of the SSL key file to use for establishing a secure connection.
Specifies if the server connection requires use of SSL. If an encrypted connection cannot be established, the connection attempt fails. Default setting is 0 (SSL not required).
Number of seconds to wait for server to start. Default = 10 seconds.
o --verbose, -v
Specify how much information to display. Use this option multiple times to increase the amount of information. For example, -v = verbose, -vv = more verbose, -vvv = debug.
Display version information and exit.
Path name of file in which to write the command used to launch the new server instance.
EXAMPLES.PP The following command demonstrates how to create a new instance of a running server, set the root user password and enable binary logging:
shell> mkdir /source/test123
shell> mysqlserverclone --server=root:pass@localhost \
--new-data=/Users/cbell/source/test123 --new-port=3310 \
# Cloning the MySQL server running on localhost.
# Creating new data directory...
# Configuring new instance...
# Locating mysql tools...
# Setting up empty database and mysql tables...
# Starting new instance of the server...
# Testing connection to new instance...
# Setting the root password...
PERMISSIONS REQUIRED.PP The user must have permission to read all databases. Since we are using the root account for these examples (and you typically would), permissions are not generally a problem.
You also need permissions to create the new data directory and write data to it.
Copyright (C) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
For more information, please refer to the MySQL Utilities and Fabric documentation, which is available online at http://dev.mysql.com/doc/index-utils-fabric.html
Oracle Corporation (http://dev.mysql.com/).