zoukankan      html  css  js  c++  java
  • mysql 权限

    grant all on *.* 
    grant 权限 on 数据库.表 to 用户@'ip地址' identified by '密码';
    刷新授权表 flush privileges
        csh.qtf
                   csh.*

    grant all on *.*    to user1@'192.168.1.%' identified by '密码';
    grant select on *.*   to  user1@'192.168.1.%' identified by '密码';
    grant select,insert,delete,update on *.*     user1@'192.168.1.%' identified by '密码';

    修改用户密码:
    mysql> update user set password=password('123456') where user='root';


    查看用户信息
    use mysql
    select User,Host,Password from user;       #查看用户信息
    show grants for 用户@'ip地址';                 #查看授权信息

    grant all on *.* 
    grant 权限 on 数据库.表 to 用户@'ip地址' identified by '密码';
    刷新授权表 flush privileges
        csh.qtf
                   csh.*

    grant all on *.*    to user1@'192.168.1.%' identified by '密码';
    grant select on *.*   to  user1@'192.168.1.%' identified by '密码';
    grant select,insert,delete,update on *.*     user1@'192.168.1.%' identified by '密码';

    查看用户信息
    use mysql
    select User,Host,Password from user;       #查看用户信息
    show grants for 用户@'ip地址';                 #查看授权信息

    revoke 权限  on *.*   from user1@'192.168.1.%';
    revoke select,insert,delete,update  on *.*   from user1@'192.168.1.%';
    flush privileges;
    show grants for user1@'192.168.1.%';

    revoke SELECT, INSERT ON `csh`.*  from 'cshuser'@'192.168.31.9' ;

    删除无效用户;
    select user,host from user;查询用户

    delete from user where User='user1';

    mysql -u用户 -p密码
    show databases;
    use 数据库名;
    例如: use  mysql;
    desc user;


    mysql> grant select on usvn.* to usvnuser@'192.168.2.251' identified by 'usersvnpwd';
    Query OK, 0 rows affected (0.01 sec)

    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)

  • 相关阅读:
    H3CNE学习2,3 TCP-IP模型
    H3CNE学习1 课程简介
    TCPDUMP抓包学习
    Kubernetes 学习26 基于kubernetes的Paas概述
    Kubernetes 学习25 创建自定义chart及部署efk日志系统
    Linux https认证原理
    Kubernetes 学习24 helm入门
    【MySQL基础总结】索引的使用
    【MySQL基础总结】常用函数库
    【MySQL基础总结】运算符的使用
  • 原文地址:https://www.cnblogs.com/520qtf/p/8857057.html
Copyright © 2011-2022 走看看