zoukankan      html  css  js  c++  java
  • 虚拟机中MySQL连接问题:Lost connection to MySQL server at 'reading initial communication packet, system error: 0 以及 host is not allowed to connect mysql

    环境:在VirtualBox中安装了Ubuntu虚拟机,网络使用了NAT模式,开启了端口转发。

    局域网内其他计算机访问虚拟机中的MySQL Server出现两个问题:

    Lost connection to MySQL server at 'reading initial communication packet, system error: 0

    以及

    host is not allowed to connect mysql

    1.解决Lost connection to MySQL server at 'reading initial communication packet, system error: 0

    修改/etc/mysql/my.cnf

    注释#bind-address = 127.0.0.1

    在[mysqld]中加入skip-name-resolve

    2.解决host is not allowed to connect mysql

    进入mysql库:

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

  • 相关阅读:
    枚举
    枚举
    比特币中的密码学原理
    贪心
    dp
    二分
    mac解决matplotlib中文乱码
    Keras使用多个GPU并行
    pyspark使用-dataframe操作
    箱线图
  • 原文地址:https://www.cnblogs.com/dreamingodd/p/6171820.html
Copyright © 2011-2022 走看看