Adding Accounts, Assigning Privileges, and Dropping Accounts OR routine privileges Creating Accounts and Granting Privileges 6.2.8 Adding Accounts, Assigning Privileges, and Dropping Accounts It may not be apparent why, if the global privileges are initially found to be insufficient for the requested operation, the server adds those privileges to the database, table, and column privileges later. The reason is that a request might require more than one type of privilege. For example, if you execute an  INSERT INTO ... SELECT  statement, you need both the  INSERT  and the  SELECT  privileges. Your privileges might be such that the  user  table row grants one privilege global and the  db  table row grants the other specifically for the relevant database. In this case, you have the necessary privileges to perform the request, but the server cannot tell that from either your global or database privileges alone. It must make an access-control decision based on the combined privileges. To manage MySQL accounts, use the SQL statements intended for that purpose: • CREATE USER  and  DROP USER  create and remove accounts. • GRANT  and  REVOKE  assign privileges to and revoke privileges from accounts. • SHOW GRANTS  displays account privilege assignments. Account-management statements cause the server to make appropriate modifications to the underlying grant tables, which are discussed in Section 6.2.3, “Grant Tables” . Direct modification of grant tables using statements such as  INSERT ,  UPDATE , or DELETE  is discouraged and done at your own risk. The server is free to ignore rows that become malformed as a result of such modifications. For any operation that modifies a grant table, the server checks whether the table has the expected structure and produces an error if not. To update the tables to the expected structure, perform the MySQL upgrade procedure. See Section 2.11, “Upgrading MySQL” . Note Another option for creating accounts is to use the GUI tool MySQL Workbench. Also, several third-party programs offer capabilities for MySQL account administration.  phpMyAdmin  is one such program. This section discusses the following topics: •Creating Accounts and Granting Privileges •Checking Account Privileges and Properties •Revoking Account Privileges •Dropping Accounts For additional information about the statements discussed here, see Section 13.7.1, “Account Management Statements” . At the command line, connect to the server as the MySQL  root  user, supplying the appropriate password at the password prompt: The following examples show how to use the  mysql  client program to set up new accounts. These examples assume that the MySQL  root  account has the  CREATE USER  privilege and all privileges that it grants to other accounts. 1222