MySQL User Account Management
595
connections, as well as information about each command issued. See
MySQL Internals: Porting to
Other Systems
.
• If you have any other problems with the MySQL grant tables and feel you must post the problem to
the mailing list, always provide a dump of the MySQL grant tables. You can dump the tables with
the
mysqldump mysql
command. To file a bug report, see the instructions at
Section 1.7, “How to
Report Bugs or Problems”
. In some cases, you may need to restart
mysqld
with
--skip-grant-
tables
[420]
to run
mysqldump
.
6.3. MySQL User Account Management
This section describes how to set up accounts for clients of your MySQL server. It discusses the
following topics:
• The meaning of account names and passwords as used in MySQL and how that compares to names
and passwords used by your operating system
• How to set up new accounts and remove existing accounts
• How to change passwords
• Guidelines for using passwords securely
• How to use secure connections with SSL
See also
Section 13.7.1, “Account Management Statements”
, which describes the syntax and use for
all user-management SQL statements.
6.3.1. User Names and Passwords
MySQL stores accounts in the
user
table of the
mysql
database. An account is defined in terms of
a user name and the client host or hosts from which the user can connect to the server. The account
may also have a password. For information about account representation in the
user
table, see
Section 6.2.2, “Privilege System Grant Tables”
.
There are several distinctions between the way user names and passwords are used by MySQL and
the way they are used by your operating system:
• User names, as used by MySQL for authentication purposes, have nothing to do with user names
(login names) as used by Windows or Unix. On Unix, most MySQL clients by default try to log in
using the current Unix user name as the MySQL user name, but that is for convenience only. The
default can be overridden easily, because client programs permit any user name to be specified
with a
-u
or
--user
option. Because this means that anyone can attempt to connect to the server
using any user name, you cannot make a database secure in any way unless all MySQL accounts
have passwords. Anyone who specifies a user name for an account that has no password is able to
connect successfully to the server.
• MySQL user names can be up to 16 characters long. Operating system user names, because
they are completely unrelated to MySQL user names, may be of a different maximum length. For
example, Unix user names typically are limited to eight characters.
Warning
The limit on MySQL user name length is hard-coded in the MySQL servers
and clients, and trying to circumvent it by modifying the definitions of the
tables in the
mysql
database does not work.
You should never alter any of the tables in the
mysql
database in any
manner whatsoever except by means of the procedure that is described in
Section 4.4.9, “
mysql_upgrade
— Check Tables for MySQL Upgrade”
.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...