美文网首页
Ubuntu 远程连接 mysql 出现 ERROR 2003

Ubuntu 远程连接 mysql 出现 ERROR 2003

作者: 橘子的皮 | 来源:发表于2020-07-13 21:52 被阅读0次

    笔者当前的版本

    • mysql Ver 14.14 Distrib 5.7.30
    • ubuntu 16.04.6

    解决方案

    查看端口是否有误,默认是3306

    1.查看远程连接权限是否打开 修改 root 用户 host = % 并且重启mysql

    update user set host='%' where user =='root';

    sudo service mysql restart

    +-----------+------------------+
    | host      | user             |
    +-----------+------------------+
    | %         | root             |
    | localhost | debian-sys-maint |
    | localhost | mysql.session    |
    | localhost | mysql.sys        |
    +-----------+------------------+
    

    2.修改mysqld.cnf ,直接注释掉bind_address

    #bind-address = 127.0.0.1

    sudo service mysql restart

    相关文章

      网友评论

          本文标题:Ubuntu 远程连接 mysql 出现 ERROR 2003

          本文链接:https://www.haomeiwen.com/subject/ivwzcktx.html