13.4 mysql用户管理 13.5 常用sql语句 13.6 mysql数据库备份恢复

13.4 mysql用户管理

  1. 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)

  2. 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)

  3. grant all on db1. to 'user3'@'%' identified by 'passwd';
    mysql> grant all on db1.
    to 'user3'@'%' identified by 'passwd';
    Query OK, 0 rows affected (0.01 sec)

  4. 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)

  5. 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 常用sql语句

13.4 mysql用户管理 13.5 常用sql语句 13.6 mysql数据库备份恢复

13.6 mysql数据库备份恢复

13.4 mysql用户管理 13.5 常用sql语句 13.6 mysql数据库备份恢复

13.4 mysql用户管理 13.5 常用sql语句 13.6 mysql数据库备份恢复
13.4 mysql用户管理 13.5 常用sql语句 13.6 mysql数据库备份恢复

转载于:https://blog.51cto.com/12058686/2090745