13.4 MySQL User management
Grant all on . to ' user1 ' identified by ' passwd ';
Mysql> Grant all on . to ' user1 ' identified by ' passwd ';
Query OK, 0 rows affected (0.01 sec)
Grant Select,update,insert on DB1. To ' user2 ' @ ' 192.168.15.132 ' identified by ' passwd ';
Mysql> mysql> Grant Select,update,insert on DB1. To ' user2 ' @ ' 192.168.15.132 ' identtified by ' passwd ';
Query OK, 0 rows affected (0.03 sec)
Grant all on DB1. To ' user3 ' @ '% ' of ' identified by ' passwd ';
Mysql> Grant all on DB1. To ' user3 ' @ '% ' of ' identified by ' passwd ';
Query OK, 0 rows affected (0.01 sec)
-
Show grants;
Mysql> show Grants\g;
1. Row
Grants for [email protected]: GRANT all privileges on . To ' root ' @ ' localhost ' identified by PASSWORD ' *617636C103DE2F02681E9CB9DD2418DD4000DF30 ' with GRANT OPTION
2. Row
Grants for [email protected]: GRANT PROXY on "@" to "root" @ ' localhost ' with GRANT OPTION
2 rows in set (0.01 SEC)
- Show grants for [email protected]
Mysql> Show grants for [email protected];
+-------------------------------------------------------------------------------------------------------------- -----+
| Grants for [email protected] |
+-------------------------------------------------------------------------------------------------------------- -----+
| GRANT USAGE on . To ' user2 ' @ ' 192.168.15.132 ' identified by PASSWORD '59c70da2f3e3a5bdf46b68f5c8b8f25762bccef0 ' |
| GRANT SELECT, INSERT, UPDATE on db1
. To ' user2 ' @ ' 192.168.15.132 ' |
+-------------------------------------------------------------------------------------------------------------- -----+
2 rows in Set (0.00 sec)
13.5 Common SQL statements
13.6 MySQL Database backup recovery
13.4 MySQL user management 13.5 Common SQL statements 13.6 MySQL database backup recovery