MySQL Phrasebook
A user is a name associated with a set of authentication credentials with an associated set of permissions. During the installation of MySQL, a user (called root) is created who has full rights to all the databases within that instance of MySQL. This user's power is similar to that of the root user on Linux and should only be used when necessary. At a minimum, each database stored within a single instance of MySQL should probably have its own administrative user account. If the database will be used by multiple users, each class of user should have its own account. Creating a User
In this section, the mysql command-line client is used to create a user with full rights to the library database. (See Chapter 7 for instructions on loading the command-line client.) GRANT ALL ON library.* TO librarian@localhost IDENTIFIED BY 'secret';
This command is parsed as follows:
To view the new user, run the following command: SHOW GRANTS FOR librarian@localhost; For more information on permissions and users, see Chapter 6, "User Management and Security." |