zoukankan      html  css  js  c++  java
  • 05数据库用户操作

    ::1表示ip结尾是1的能通过root用户来访问这台机器的数据库

    创建用户

    CREATE USER 'woaiwenmeng'@'127.0.0.1' IDENTIFIED BY '123'

     查看用户权限

    SHOW GRANTS FOR 'woaiwenmeng'@'127.0.0.1';

    授权

    GRANT SELECT,UPDATE ON db1.info1 TO 'woaiwenmeng'@'127.0.0.1';

      授权了查询和修改功能,未授权的不能执行

      有以下权限:

      

    GRANT ALL PRIVILEGES ON *.* TO 'woaiwenmeng'@'127.0.0.1';#授予除了grant权限之外的所有权限

    取消授权

    REVOKE ALL PRIVILEGES ON *.* FROM 'woaiwenmeng'@'127.0.0.1';#To变成了FROM   从指定用户下移除当前用户的所有授权

    移除用户

    DROP USER 'woaiwenmeng'@'127.0.0.1';

    修改用户名字

    RENAME USER 'woaiwenmeng'@'127.0.0.1' TO 'wenmeng'@'192.168.0.1';

    局域网连接测试:

    CREATE USER 'test'@'%' IDENTIFIED BY '123456';#%表示所有的ip
    
    GRANT ALL PRIVILEGES ON *.* TO 'test'@'%';
    
    FLUSH PRIVILEGES;    #刷新权限

    修改用户密码

  • 相关阅读:
    Binary Tree Paths
    Implement Stack using Queues
    Path Sum II
    Path Sum
    Plus One
    Add Digits
    Missing Number
    H-Index II
    H-Index
    Ugly Number II
  • 原文地址:https://www.cnblogs.com/start20180703/p/10326599.html
Copyright © 2011-2022 走看看