1MYSQLSERVERCLONE() MYSQLSERVERCLONE()
2
3
4
6 mysqlserverclone - Clone Existing Server to Create New Server
7
9 mysqlserverclone [options]
10
12 This utility enables you to clone an existing MySQL server instance to
13 create a new server instance on the same host. The utility creates a
14 new datadir (--new-data), and, on Unix systems, starts the server with
15 a socket file. You can optionally add a password for the login user
16 account on the new instance.
17
18 If the user does not have read and write access to the folder specified
19 by the --new-data option, the utility shall issue an error.
20
21 Similarly, if the folder specified by
22 --new-data exists and is not empty, the utility will not delete the
23 folder and will issue an error message. Users must specify the
24 --delete-data option to permit the utility to remove the folder prior
25 to starting the cloned server. OPTIONS.PP mysqlserverclone accepts the
26 following command-line options:
27
28 · --help
29
30 Display a help message and exit.
31
32 · --license
33
34 Display license information and exit.
35
36 · --delete-data
37
38 Delete the folder specified by --new-data if it exists and is not
39 empty.
40
41 · --basedir
42
43 The base directory for the MySQL server source, as an alternative
44 to the --server option.
45
46 shell> mysqlserverclone --basedir=/source/mysql-5.6 \
47 --new-data=/source/temp_3007 --new-port=3007 --new-id=101 \
48 --root=root --mysqld="--log-bin --gtid-mode=on --log-slave-updates \
49 --enforce-gtid-consistency --master-info-repository=table \
50 --report-host=localhost --report-port=3007" --delete
51
52 · --force
53
54 Ignore the maximum path length and the low space checks for the
55 --new-data option.
56
57 · --mysqld=<options>
58
59 Additional options for mysqld. To specify multiple options,
60 separate them by spaces. Use appropriate quoting as necessary. For
61 example, to specify --log-bin=binlog and
62 --general-log-file="mylogfile", use:
63
64 If the option --skip-innodb is included when connecting to a MySQL
65 server version 5.7.5 or higher, the option is ignored and a warning
66 is issued.
67
68 --mysqld="--log-bin=binlog --general-log-file='my log file'"
69
70 · --new-data=<path_to_new_datadir>
71
72 The full path to the location of the data directory for the new
73 instance. The path size must be 200 characters or less and it
74 requires at least 120 MB of free space.
75
76 · --new-id=<server_id>
77
78 The server_id value for the new server instance. The default is 2.
79
80 · --new-port=<port>
81
82 The port number for the new server instance. The default is 3307.
83
84 · --quiet, -q
85
86 Turn off all messages for quiet execution.
87
88 · --root-password=<password>
89
90 The password for the root user of the new server instance.
91
92 · --server=<source>
93
94 Connection information for the server to be cloned.
95
96 To connect to a server, it is necessary to specify connection
97 parameters such as user name, host name, password, and either a
98 port or socket. MySQL Utilities provides a number of ways to
99 provide this information. All of the methods require specifying
100 your choice via a command-line option such as --server, --master,
101 --slave, etc. The methods include the following in order of most
102 secure to least secure.
103
104 · Use login-paths from your .mylogin.cnf file (encrypted, not
105 visible). Example : <login-path>[:<port>][:<socket>]
106
107 · Use a configuration file (unencrypted, not visible) Note:
108 available in release-1.5.0. Example :
109 <configuration-file-path>[:<section>]
110
111 · Specify the data on the command-line (unencrypted, visible).
112 Example : <user>[:<passwd>]@<host>[:<port>][:<socket>]
113
114
115 · --ssl-ca
116
117 The path to a file that contains a list of trusted SSL CAs.
118
119 · --ssl-cert
120
121 The name of the SSL certificate file to use for establishing a
122 secure connection.
123
124 · --ssl-cert
125
126 The name of the SSL key file to use for establishing a secure
127 connection.
128
129 · --ssl
130
131 Specifies if the server connection requires use of SSL. If an
132 encrypted connection cannot be established, the connection attempt
133 fails. Default setting is 0 (SSL not required).
134
135 · --start-timeout=<timeout_in_seconds>
136
137 Number of seconds to wait for server to start. Default = 10
138 seconds.
139
140 · --verbose, -v
141
142 Specify how much information to display. Use this option multiple
143 times to increase the amount of information. For example, -v =
144 verbose, -vv = more verbose, -vvv = debug.
145
146 · --version
147
148 Display version information and exit.
149
150 · --write-command=<file_name>, -w<file_name>
151
152 Path name of file in which to write the command used to launch the
153 new server instance.
154 EXAMPLES.PP The following command demonstrates how to create a new
155 instance of a running server, set the root user password and enable
156 binary logging:
157
158 shell> mkdir /source/test123
159 shell> mysqlserverclone --server=root:pass@localhost \
160 --new-data=/Users/cbell/source/test123 --new-port=3310 \
161 --root-password=pass --mysqld=--log-bin=mysql-bin
162 # Cloning the MySQL server running on localhost.
163 # Creating new data directory...
164 # Configuring new instance...
165 # Locating mysql tools...
166 # Setting up empty database and mysql tables...
167 # Starting new instance of the server...
168 # Testing connection to new instance...
169 # Success!
170 # Setting the root password...
171 # ...done.
172
173 PERMISSIONS REQUIRED.PP The user must have permission to read all
174 databases. Since we are using the root account for these examples (and
175 you typically would), permissions are not generally a problem.
176
177 You also need permissions to create the new data directory and write
178 data to it.
179
181 Copyright © 2006, 2015, Oracle and/or its affiliates. All rights
182 reserved.
183
184 This documentation is free software; you can redistribute it and/or
185 modify it only under the terms of the GNU General Public License as
186 published by the Free Software Foundation; version 2 of the License.
187
188 This documentation is distributed in the hope that it will be useful,
189 but WITHOUT ANY WARRANTY; without even the implied warranty of
190 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
191 General Public License for more details.
192
193 You should have received a copy of the GNU General Public License along
194 with the program; if not, write to the Free Software Foundation, Inc.,
195 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see
196 http://www.gnu.org/licenses/.
197
198
200 For more information, please refer to the MySQL Utilities and Fabric
201 documentation, which is available online at
202 http://dev.mysql.com/doc/index-utils-fabric.html
203
205 Oracle Corporation (http://dev.mysql.com/).
206
207
208
209 MYSQLSERVERCLONE()