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:
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 user has no username; you can use it to connect to the server without supplying 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 ...