Mysql> GRANT All privileges on * * to ' monty ' @ ' localhost '
- identified by ' Some_pass ' with GRANT OPTION;
Mysql> GRANT All privileges on * * to ' monty ' @ '% '
- identified by ' Some_pass ' with GRANT OPTION;
Mysql> GRANT reload,process on * * to ' admin ' @ ' localhost ';
Mysql> GRANT USAGE on *. * to ' dummy ' @ ' localhost ';
The account created with the GRANT statement has the following properties:
• Two of these accounts have the same username Monty and password Some_pass. Two accounts are super user accounts with full privileges to do anything. An account (' Monty ' @ ' localhost ') is only used when connecting from the local computer. Another account (' Monty ' @ '% ') can be used to connect from other hosts. Please note that Monty's two accounts must be able to connect to Monty from any host. Without a localhost account, the anonymous user account for localhost created by mysql_install_db will be preempted when Monty is connected from the local computer. As a result, Monty will be treated as an anonymous user. The reason is that the host column value of the anonymous user account is more specific than the ' Monty ' @ '% ' account, which is preceded by the user table sort order. (The user table sorts the discussion to refer to the MySQL manual).