zoukankan      html  css  js  c++  java
  • 修改mysql连接的密码

    mysql8.0修改密码:

    ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '你的password';

    msyql开启实现远程连接

       将host字段的值改为%就表示在任何客户端机器上能以root用户登录到mysql服务器,建议在开发时设为%。   
       update user set host = ’%’ where user = ’root’;

       将权限改为ALL PRIVILEGES

    mysql> use mysql;
    Database changed
    mysql> grant all privileges  on *.* to root@'%' identified by "password";
    Query OK, 0 rows affected (0.00 sec)

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

    mysql> select host,user,password from user;
    +--------------+------+-------------------------------------------+
    | host           | user | password                                  |
    +--------------+------+-------------------------------------------+
    | localhost    | root | *A731AEBFB621E354CD41BAF207D884A609E81F5E |
    | %               | root | *A731AEBFB621E354CD41BAF207D884A609E81F5E |
    +--------------+------+-------------------------------------------+
    3 rows in set (0.00 sec)

    这样机器就可以以用户名root密码root远程访问该机器上的MySql.

  • 相关阅读:
    CentOS重置Mysql密码
    2017年2月21日20:35:46
    UEFI+GPT安装windows
    CentOS 7.0 使用 yum 安装 MariaDB 与 MariaDB 的简单配置
    CentOS利用nginx和php-fpm搭建owncloud私有云
    Docker安装CentOS
    CoreOS和Docker入门
    Docker命令学习
    CentOS安装Redis详细教程
    Redis的三种启动方式
  • 原文地址:https://www.cnblogs.com/sirwang/p/9630734.html
Copyright © 2011-2022 走看看