虚拟机中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;

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

时间: 2024-08-02 10:44:53

虚拟机中MySQL连接问题:Lost connection to MySQL server at 'reading initial communication packet, system error: 0 以及 host is not allowed to connect mysql的相关文章

Lost connection to MySQL server at ‘reading initial communication packet', system error: 0 mysql远程连接问题

在用Navicat for MySQL远程连接mysql的时候,出现了 Lost connection to MySQL server at ‘reading initial communication packet', system error: 0 好恶心,服务器重启了一次,就一上午都是在处理mysql的各种问题. 第一步:找到:my.cnf文件 其实我也不知道在哪里,用指令帮我们找吧. find / -name my.cnf 找到了后. 第二步:vi my.cnf vi my.cnf 在m

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

在用Navicat for MySQL远程连接mysql的时候,出现了 Lost connection to MySQL server at ‘reading initial communication packet', system error: 0 修改my.cnf文件(windows为my.ini) 一般在mysql的安装目录,/etc/mycnf. 在my.cnf配置文件中的[mysqld]区域添加skip-name-resolve,看网友说的是跳过mysql连接的DNS反向解析功能,这

mysql登陆时出现ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

有4到5天没开mysql,这天晚上打=打开phpstudy,想进去mysql练习练习,结果丢给我这个 ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0 错误2013 (HY000):读取初始通信包时MySQL服务器连接丢失,系统错误0 windows进cmd命令行,输入server.msc,然后找到mysql的服务,重启一下就

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

如果网上各种文档告诉你去配置/etc/my.cnf,你没找到的话,不防试试我这个,文件的位置在: 去里面找找看 注释掉bind-address 然后重置下密码: use mysql update user set authentication_string=password('wxhcj1314520'),plugin='mysql_native_password' where user='root'; 然后刷新一下: flush privileges; Lost connection to M

使用cmd命令登录mysql数据库时报2013-Lost connection to MYSQL server at 'waiting for initial communication packet',system error:0

[错误内容]:SQL Error (2013): Lost connection to MySQL server at 'waiting for initial communication packet', system error: 0 [错产生经过]:链接MySQL时出现. [解决办法]:打开my.ini,找到[mysqld]项,在其后加入一句:skip-name-resolve,保存,重启mysql服务即可~ 以上就是解决MySQL Error (2013): Lost connectio

navicat远程连接阿里云ECS上的MYSQL报Lost connection to MySQL server at 'reading initial communication packet'

问题现象 MySQL 远程连接报错:Lost connection to MySQL server at 'reading initial communication packet' 解决方案 1.检查是否有防火墙限制2.检查 MySQL 是否有访问权限 use mysql; Grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option; flush privileges; 3.检查 my.ini 文

2013 - Lost connection to MySQL server at 'reading initial communication packet' 错误解决

一.操作与状态 当使用MySQL客户端连接localhost本地数据库时,连接不上,报错.(使用Tomcat连接数据库时可以连接上,但需要很长的请求时间.) 二.原因与解决办法 关于这个问题网上的解决方法基本个不相同,并且答案也比较少,最后发现是由于自己手欠在电脑管家的"网络优化中"禁用了MySQL程序的网络,恢复连接即可. 2013 - Lost connection to MySQL server at 'reading initial communication packet'

mysql Lost connection to MySQL server at ‘reading initial communication packet

mysql 爆出,本地连接正常,远程链接无法链接,爆出错误Lost connection to MySQL server at 'reading initial communication packet 大量无法远程链接的问题1.iptables 导致 看看iptables -L 2.mysqld 下增加skip-name-resolve我加了发现不行看下面 3.bind-adress我发现mysqld 还有一句 bind-address = ::ffff:127.0.0.1 [mysqld]#

Lost connection to MySQL server at ‘reading initial communication packet错误解决

今天线上mysql报错,连不上了,报错信息大致为Lost connection to MySQL server at 'reading initial communication packet.然后在网上找了些解决办法,这边一个一个来说明,方便以后在遇到这样的问题不知道怎么解决: 最后查找到的原因是/var/lib/mysql/下面的mysql.sock不见了,为什么不见的还没有找到,下面说下解决的办法: ERROR 2002 (HY000): Can't connect to local My