zoukankan      html  css  js  c++  java
  • linux下mysql权限配置

    先登入mysql
    mysql -u root -p

    然后回车键入密码!

    1.2 赋予主机B操作数据库的权限

    mysql> grant usage on *.* to username@192.168.0.1 identified by 'password';

    说明:赋予username@192.168.0.1 使用所有数据库的权限,在主机192.168.0.1上使用username账户登录,密码为:password

    mysql> grant usage on *.* to username identified by 'password';

    说明:赋予username使用所有数据库的权限,在所有主机上使用username账户登录,密码为:password

    mysql> grant all privileges on newdb.* to username@192.168.0.1;

    说明:赋予username@192.168.0.1 操作数据库newdb的最高权限,在主机192.168.0.1上使用username账户登录,无密码

    举例:

    mysql> grant all privileges on *.* to root@192.168.0.1 identified by '123456' ;

    说明:赋予root@192.168.0.1 使用所有数据库的权限,在主机192.168.0.1上使用root账户登录,密码为:123456

    移除账户

    mysql> drop user root@192.168.0.1;

    说明:移除账户root,这样,主机192.168.0.1就不再可以使用root用户操作服务器上的数据库

    使权限生效

    mysql> flush privileges;
  • 相关阅读:
    java多线程之系列目录
    RecyclerView的源码分析
    ConCurrentHashMap在1.7和1.8区别
    插件化之细节
    组件化之开发细节
    组件化之开发总结
    线程之volatile基本内容
    线程之Synchronized基本内容
    设计模式之动态代理模式原理介绍
    操作系统之内存映射
  • 原文地址:https://www.cnblogs.com/simon-sun/p/3349839.html
Copyright © 2011-2022 走看看