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;
  • 相关阅读:
    N皇后问题
    SDNU1349.快速幂入门
    SDNU1522.陆历川学数学
    埃氏筛
    快速幂
    string函数
    Golang介绍以及安装
    Promise解决回调地狱(多层调用问题)
    JavaScript动画相关
    ES6简单语法
  • 原文地址:https://www.cnblogs.com/simon-sun/p/3349839.html
Copyright © 2011-2022 走看看