Databases Reference
In-Depth Information
mysql> SET PASSWORD FOR 'partmusic'@'localhost' =
'*14E65567ABDB5135D0CFD9A70B3032C179A49EE7'
Query OK, 0 rows affected (0.00 sec)
Again, you can now connect using the plain-text password the_password .
The Default Users
This section explains the user accounts that are created when MySQL is installed and
shows you how to secure your installation by making important changes to these
default settings. The next section explains how to put together the things you've learned
to develop a complete user security policy.
When you install your MySQL server, it comes preconfigured with one or two default
users. The privileges of these users and the locations vary between operating systems,
but you must ensure that their privileges match your requirements, and make decisions
about the machines that connections to your database server can come from; you might
also decide to remove one or more of the default users. Before we explain how to make
these decisions, let's discuss the users and how they access the server.
On all platforms, MySQL may come installed with two users:
root
This is the superuser, who can do anything to the server, users, databases, and
data. The superuser usually creates new users who have authority to access and
manipulate specific databases. Once you've installed MySQL, you must configure
the root user, and we show you how to do this later in this section.
anonymous
This user has no username; you can use it to connect to the server without sup-
plying any credentials. Also, as described earlier in “Anonymous Users,” it is used
when host credentials match but the requested username doesn't. The anonymous
user has very limited privileges by default; in the next section, we'll explain what
these are.
Both users have no password by default. With the anonymous user, this means you
can connect to the database server without a username and password. For the root
user, you supply the username root , but there's no password. Again, these are user
accounts on the MySQL server, not on the operating system (Linux, Windows, or Mac
OS X).
Default User Configuration
The default installation allows the default users to access the server, but the machines
they can connect from depend on whether you're using Windows or a Unix-like system,
such as Linux or Mac OS X. This section shows you the GRANT statements used to create
the default users and explains what they mean in practice.
 
Search WWH ::




Custom Search