zoukankan      html  css  js  c++  java
  • MySQL 远程连接问题 (Linux Server)

    Mysql Workbench 连接Ubuntu上的Mysql时报如下错误:

    原因:查看  /etc/mysql/mysql.conf.d/mysqld.cnf

    #
    # Instead of skip-networking the default is now to listen only on
    # localhost which is more compatible and is not less secure.
    bind-address            = 127.0.0.1

    默认只支持本地访问。

    修改为:

    #
    # Instead of skip-networking the default is now to listen only on
    # localhost which is more compatible and is not less secure.
    bind-address            = 0.0.0.0

    然后重启Mysql :

    service mysql restart

    再重新连接报如下错误:

    查找原因:

     

    显示只能localhost 访问。

    解决方法:修改授权远程访问

    修改:

    mysql> update user set host="%" where user="root";

    或新增:

    grant all privileges on *.* to 'root'@'%'  identified by 'admin123' with grant option;
    flush privileges;

    %代表通配,也可换成IP地址。

  • 相关阅读:
    OD 实验(十三)
    第一个 Windows 界面程序
    C 语言
    C 语言
    OD 实验(十二)
    PowerShell 常用命令
    OD 实验(十一)
    OD 实验(十)
    redis
    memcached缓存系统
  • 原文地址:https://www.cnblogs.com/zoneofmine/p/11035688.html
Copyright © 2011-2022 走看看