zoukankan      html  css  js  c++  java
  • Mysql给某一台主机授权访问,修改root密码

    ubuntu上用的是phpstudy,安装好之后,敲mysql,提示没有,需要安装mysql的客户端。

    安装好之后直接敲mysql,敲 mysql

    再敲use mysql

    再敲mysql -uroot -p

    马拉个蛋,还不对。敲quit退出。

    重新敲 mysql -u root -p,竟然可以啦!!!

    再敲use mysql

    这次一定要删掉匿名登录的用户 delete from user where user='';

    然后我想修改root的密码啦,之前的root密码太简单了。

    敲入 update user set password=PASSWORD('rootrun') where user='root';

    然后,我想从远程主机登录这个账号 update user set host='%' where user='root' and host='192.168.10.90';

    如果想授予root在任意主机访问数据库的权限 grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;

    FLUSH PRIVILEGES;刷新权限命令!!!

     

    参考:http://www.jb51.net/article/58096.htm

  • 相关阅读:
    实验四
    实验三
    实验二
    实验一
    6
    5
    4
    3
    shiyan2
    实验1
  • 原文地址:https://www.cnblogs.com/peteremperor/p/6853363.html
Copyright © 2011-2022 走看看