.TH "MYSQLUSERCLONE" "1" "May 09, 2012" "1.0.3" "MySQL Utilities" .SH NAME mysqluserclone \- Copy a MySQL user to one or more new users on another server . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .\" Man page generated from reStructeredText. . .SH SYNOPSIS .sp .nf .ft C mysqluserclone [options] base_user new_user[:password][@host_name] ... .ft P .fi .SH DESCRIPTION .sp This utility uses an existing MySQL user account on one server as a template, and clones it to create one or more new user accounts with the same privileges as the original user. The new users can be created on the original server or a different server. .sp To list users for a server, specify the \fI\%--list\fP option. This prints a list of the users on the source (no destination is needed). To control how to display list output, use one of the following values with the \fI\%--format\fP option: .INDENT 0.0 .TP .B \fBgrid\fP (default) Display output in grid or table format like that of the \fBmysql\fP monitor. .TP .B \fBcsv\fP Display output in comma\-separated values format. .TP .B \fBtab\fP Display output in tab\-separated format. .TP .B \fBvertical\fP Display output in single\-column format like that of the \fB\eG\fP command for the \fBmysql\fP monitor. .UNINDENT .SH OPTIONS .sp \fBmysqluserclone\fP accepts the following command\-line options: .INDENT 0.0 .TP .B \-\-help Display a help message and exit. .UNINDENT .INDENT 0.0 .TP .B \-\-destination= Connection information for the destination server in <\fIuser\fP>[:<\fIpasswd\fP>]@<\fIhost\fP>[:<\fIport\fP>][:<\fIsocket\fP>] format. .UNINDENT .INDENT 0.0 .TP .B \-\-dump, \-d Display the \fBGRANT\fP statements to create the account rather than executing them. In this case, the utility does not connect to the destination server and no \fI\%--destination\fP option is needed. .UNINDENT .INDENT 0.0 .TP .B \-\-format=, \-f Specify the user display format. Permitted format values are \fBgrid\fP, \fBcsv\fP, \fBtab\fP, and \fBvertical\fP. The default is \fBgrid\fP. This option is valid only if \fI\%--list\fP is given. .UNINDENT .INDENT 0.0 .TP .B \-\-force Drop the new user account if it exists before creating the new account. Without this option, it is an error to try to create an account that already exists. .UNINDENT .INDENT 0.0 .TP .B \-\-include\-global\-privileges Include privileges that match \fBbase_user@%\fP as well as \fBbase_user@host\fP. .UNINDENT .INDENT 0.0 .TP .B \-\-list List all users on the source server. With this option, a destination server need not be specified. .UNINDENT .INDENT 0.0 .TP .B \-\-quiet, \-q Turn off all messages for quiet execution. .UNINDENT .INDENT 0.0 .TP .B \-\-source= Connection information for the source server in <\fIuser\fP>[:<\fIpasswd\fP>]@<\fIhost\fP>[:<\fIport\fP>][:<\fIsocket\fP>] format. .UNINDENT .INDENT 0.0 .TP .B \-\-verbose, \-v Specify how much information to display. Use this option multiple times to increase the amount of information. For example, \fI\-v\fP = verbose, \fI\-vv\fP = more verbose, \fI\-vvv\fP = debug. .UNINDENT .INDENT 0.0 .TP .B \-\-version Display version information and exit. .UNINDENT .SH NOTES .sp You must provide connection parameters (user, host, password, and so forth) for an account that has the appropriate privileges to access all objects in the operation. .sp The account used to connect to the source server must have privileges to read the \fBmysql\fP database. .sp The account used to connect to the destination server must have privileges to execute \fBCREATE USER\fP (and \fBDROP USER\fP if the \fI\%--force\fP option is given), and privileges to execute \fBGRANT\fP for all privileges to be granted to the new accounts. .sp For the \fI\%--format\fP option, the permitted values are not case sensitive. In addition, values may be specified as any unambiguous prefix of a valid value. For example, \fI\-\-format=g\fP specifies the grid format. An error occurs if a prefix matches more than one valid value. .SH EXAMPLES .sp To clone \fBjoe\fP as \fBsam\fP and \fBsally\fP with passwords and logging in as \fBroot\fP on the local machine, use this command: .sp .nf .ft C $ mysqluserclone \-\-source=root@localhost \e \-\-destination=root@localhost \e joe@localhost sam:secret1@localhost sally:secret2@localhost # Source on localhost: ... connected. # Destination on localhost: ... connected. # Cloning 2 users... # Cloning joe@localhost to user sam:secret1@localhost # Cloning joe@localhost to user sally:secret2@localhost # ...done. .ft P .fi .sp The following command shows all users on the local server in the most verbose output in CSV format: .sp .nf .ft C $ mysqluserclone \-\-source=root@localhost \-\-list \-\-format=csv \-vvv # Source on localhost: ... connected. user,host,database joe,localhost,util_test rpl,localhost, sally,localhost,util_test sam,localhost,util_test joe,user,util_test .ft P .fi .SH COPYRIGHT .sp Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. .sp This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .sp This program 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. .sp You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110\-1301 USA .SH AUTHOR MySQL Utilities Team .SH COPYRIGHT 2010, Oracle and/or its affiliates. All rights reserved. .\" Generated by docutils manpage writer. .\" .