码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2018-03-24 22:30:12      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:13.4 mysql用户管理 13.5

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 root@localhost: GRANT ALL PRIVILEGES ON . TO ‘root‘@‘localhost‘ IDENTIFIED BY PASSWORD ‘*617636C103DE2F02681E9CB9DD2418DD4000DF30‘ WITH GRANT OPTION
    2. row
    Grants for root@localhost: GRANT PROXY ON ‘‘@‘‘ TO ‘root‘@‘localhost‘ WITH GRANT OPTION
    2 rows in set (0.01 sec)

  5. show grants for user2@192.168.133.1

    mysql> show grants for user2@192.168.15.132;
    +-------------------------------------------------------------------------------------------------------------------+
    | Grants for user2@192.168.15.132 |
    +-------------------------------------------------------------------------------------------------------------------+
    | 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.6 mysql数据库备份恢复

技术分享图片

技术分享图片
技术分享图片

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

标签:13.4 mysql用户管理 13.5

原文地址:http://blog.51cto.com/12058686/2090745

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!