1MYSQLUSERCLONE(1) MySQL Utilities MYSQLUSERCLONE(1)
2
3
4
6 mysqluserclone - Copy a MySQL user to one or more new users on another
7 server
8
10 mysqluserclone --source=<user>[<passwd>]@<host>:[<port>][:<socket>]
11 --destination=<user>[<passwd>]@<host>:[<port>][:<socket>]
12 [[--help | --version | --list | --format=<format>] |
13 [ --dump | --verbose | --force | --quiet |
14 --include-global-privileges ] <base_user>
15 <new_user>[:<password>] [,<new_user>[:<password>]]]
16
18 This utility permits a database administrator to use an existing user
19 account on one server as a template, clone a MySQL user such that one
20 or more new user accounts are created on another (or the same) server
21 with the same privileges as the original user.
22
23 You must provide login information such as user, host, password, etc.
24 for a user that has the appropriate rights to access all objects in the
25 operation. See mysqluserclone-notes below for more details.
26
27 You can also use the utility to list users for a server by specifying
28 the --list option. This prints a list of the users on the source (no
29 destination is needed). You can also control the output of the list
30 using the --format option.
31
33 --version
34 show version number and exit
35
36 --help show the help page
37
38 --source <source>
39
40 connection information for source server in the form:
41 <user>:<password>@<host>:<port>:<socket> where <password> is
42 optional and either <port> or <socket> must be provided.
43
44 --destination <destinatio>
45
46 connection information for destination server in the form:
47 <user>:<password>@<host>:<port>:<socket> Where <password> is
48 optional and either <port> or <socket> must be provided.
49
50 --copy-dir <directory>
51
52 Path to use when copying data (stores temporary files) - default
53 = current directory
54
55 --dump, -d
56
57 dump GRANT statements for user
58
59 --force, -f
60
61 drop the new user if it exists
62
63 --quiet, -q
64
65 turn off all messages for quiet execution
66
67 --verbose, -v
68
69 control how much information is displayed. For example, -v =
70 verbose, -vv = more verbose, -vvv = debug
71
72 --include-global-privileges
73 include privileges that match base_user@% as well as
74 base_user@host
75
76 --list list all users on the source - does not require a destination
77
78 --format=LIST_FORMAT
79
80 display the list of users in either GRID (default), TAB, CSV, or
81 VERTICAL format - valid only for --list option
82
84 The login user must have the appropriate permissions to create new
85 users, access (read) the mysql database, and grant privileges. At a
86 minimum, this requires the login user to have read on the mysql data‐
87 base, the WITH GRANT OPTION for all databases listed in the GRANT
88 statements found, and the ability to create a user account.
89
91 To clone 'joe' as 'sam' and 'sally' with passwords and logging in as
92 root on the local machine, use this command:
93
94 $ mysqluserclone --source=root@localhost \\
95 --destination=root@localhost \\
96 joe@localhost sam:secret1@localhost sally:secret2@localhost
97 # Source on localhost: ... connected.
98 # Destination on localhost: ... connected.
99 # Cloning 2 users...
100 # Cloning joe@localhost to user sam:secret1@localhost
101 # Cloning joe@localhost to user sally:secret2@localhost
102 # ...done.
103
104 The following shows all of the users on the localhost server in the
105 most verbose output in a CSV format.:
106
107 $ mysqluserclone --source=root@localhost --list --format=CSV -vvv
108 # Source on localhost: ... connected.
109 user,host,database
110 joe,localhost,util_test
111 rpl,localhost,
112 sally,localhost,util_test
113 sam,localhost,util_test
114 joe,user,util_test
115
117 Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
118
119 This program is free software; you can redistribute it and/or modify it
120 under the terms of the GNU General Public License as published by the
121 Free Software Foundation; version 2 of the License.
122
123 This program is distributed in the hope that it will be useful, but
124 WITHOUT ANY WARRANTY; without even the implied warranty of MER‐
125 CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
126 Public License for more details.
127
128 You should have received a copy of the GNU General Public License along
129 with this program; if not, write to the Free Software Foundation, Inc.,
130 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
131
133 MySQL Utilities Team
134
136 2010, Oracle and/or its affiliates. All rights reserved.
137
138
139
140
1411.0.1 September 23, 2011 MYSQLUSERCLONE(1)