Account Management Statements Each account name uses the format described in Section 6.2.4, “Specifying Account Names” . Each role name uses the format described in Section 6.2.5, “Specifying Role Names” . For example: The host name part of the account or role name, if omitted, defaults to  ’%’ . Normally, a database administrator first uses  CREATE USER  to create an account and define its nonprivilege characteristics such as its password, whether it uses secure connections, and limits on access to server resources, then uses  GRANT  to define its privileges.  ALTER USER  may be used to change the nonprivilege characteristics of existing accounts. For example: From the  mysql  program,  GRANT  responds with  Query OK, 0 rows affected  when executed successfully. To determine what privileges result from the operation, use  SHOW GRANTS . See Section 13.7.7.21, “SHOW GRANTS Statement” . Under some circumstances,  GRANT  may be recorded in server logs or on the client side in a history file such as  ~/.mysql_history , which means that cleartext passwords may be read by anyone having read access to that information. For information about the conditions under which this occurs for the server logs and how to control it, see Section 6.1.2.3, “Passwords and Logging” . For similar information about client-side logging, see Section 4.5.1.3, “mysql Client Logging” . GRANT  supports host names up to 255 characters long (60 characters prior to MySQL 8.0.17). User names can be up to 32 characters. Database, table, column, and routine names can be up to 64 characters. Do not attempt to change the permissible length for user names by altering the mysql.user  system table. Doing so results in unpredictable behavior which may even make it impossible for users to log in to the MySQL server . Never alter the structure of tables in the  mysql  system schema in any manner except by means of the procedure described in Section 2.11, “Upgrading MySQL” . Several objects within  GRANT  statements are subject to quoting, although quoting is optional in many cases: Account, role, database, table, column, and routine names. For example, if a  user_name  or host_name  value in an account name is legal as an unquoted identifier, you need not quote it. However, quotation marks are necessary to specify a  user_name  string containing special characters (such as  - ), or a  host_name  string containing special characters or wildcard characters such as  %  (for example,  ’test- user’@’%.com’ ). Quote the user name and host name separately. To specify quoted values: •Quote database, table, column, and routine names as identifiers. •Quote user names and host names as identifiers or as strings. •Quote passwords as strings. 2865 Warning Important Object Quoting Guidelines GRANT ALL ON db1.* TO ’jeffrey’@’localhost’; GRANT ’role1’, ’role2’ TO ’user1’@’localhost’, ’user2’@’localhost’; GRANT SELECT ON world.* TO ’role3’; CREATE USER ’jeffrey’@’localhost’ IDENTIFIED BY ’ password ’; GRANT ALL ON db1.* TO ’jeffrey’@’localhost’; GRANT SELECT ON db2.invoice TO ’jeffrey’@’localhost’; ALTER USER ’jeffrey’@’localhost’ WITH MAX_QUERIES_PER_HOUR 90;