2.4. Setting Up MySQL Accounts

An account is identified by the account name and the name of the computer allowed to access MySQL from this account. When you create a new account, you specify it as accountname@hostname. You can specify a password when you create an account, or you can add a password later. You can also set up privileges when you create an account or add privileges later.

All the account information is stored in a database named mysql that's automatically created when MySQL is installed. To add a new account or change any account information, you must use an account that has the proper privileges on the mysql database.

In the rest of this chapter, we describe how to add and delete accounts and change passwords and privileges for accounts. If you have an account that you received from your company IT department or from a Web hosting company, you might receive an error when you try to add an account or change account privileges as described in this chapter. If your account is restricted from performing any of the necessary queries, you need to request an account with more privileges or ask the MySQL administrator to add a new account for you or make the changes you need.

NOTE

The MySQL security database

When MySQL is installed, it automatically creates a database called mysql. All the information used to protect your data is stored in this database, including account names, hostnames, passwords, and privileges.

Privileges are stored in columns. The format of each ...

Get PHP & MySQL® Web Development All-in-One Desk Reference for Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.