Lost connection to MySQL server at 'reading initial communication packet et system error:0
2017-10-06 13:01
761 查看
突然在今天重装系统的时候发现,mysql竟然不能连接 ? &*……*
关于这个问题,有以下几点问题
1. my.ini文件里是否设置了bind-address 参数(没用)
2. 同样也是在my.ini文件中加入skip-name-resolve(然后还是发现没有什么用)
——–关于1和2点是参考网上的,还是那个问题,网上大部分都是喜欢复制粘贴别人的回答,自己很多根本都没有去尝试或者遇到的问题,所以自己踩过的坑,让自己以后不踩了,也让其他网友少踩一些
在这里还遇到了一个问题,那就是修改my.ini的时候没有权限,要切换到炒鸡管理员账号
然后我突然想到了是否把主机名(localhost)和IP(127.0.0.1)地址替换一下,结果……就行了?嗯,对,就行了
然后针对于这问题,不仅思考了下localhost和127.0.0.1有什么区别?
使用127.0.0.1的时候,使用的是TCP/IP连接, mysql server 认为该连接来自于127.0.0.1或者是localhost.localdomain
使用localhost的时候,是不使用TCP/IP连接的,而使用Unix socket;此时,mysql server则认为该client是来自”localhost”
但是看着好像没道理
后来再看到网上说在my.ini中加入protocol=tcp,因为懒得切换到炒鸡管理员,所以这个问题先mark吧,后面想起的时候再试试
关于这个问题,有以下几点问题
1. my.ini文件里是否设置了bind-address 参数(没用)
2. 同样也是在my.ini文件中加入skip-name-resolve(然后还是发现没有什么用)
——–关于1和2点是参考网上的,还是那个问题,网上大部分都是喜欢复制粘贴别人的回答,自己很多根本都没有去尝试或者遇到的问题,所以自己踩过的坑,让自己以后不踩了,也让其他网友少踩一些
在这里还遇到了一个问题,那就是修改my.ini的时候没有权限,要切换到炒鸡管理员账号
然后我突然想到了是否把主机名(localhost)和IP(127.0.0.1)地址替换一下,结果……就行了?嗯,对,就行了
然后针对于这问题,不仅思考了下localhost和127.0.0.1有什么区别?
使用127.0.0.1的时候,使用的是TCP/IP连接, mysql server 认为该连接来自于127.0.0.1或者是localhost.localdomain
使用localhost的时候,是不使用TCP/IP连接的,而使用Unix socket;此时,mysql server则认为该client是来自”localhost”
但是看着好像没道理
后来再看到网上说在my.ini中加入protocol=tcp,因为懒得切换到炒鸡管理员,所以这个问题先mark吧,后面想起的时候再试试
相关文章推荐
- ubuntu下连接mysql时报错:Lost connection to MySQL server at 'reading initial communication packet', system
- Lost connection to MySQL server at ‘reading initial communication packet’
- MySql Lost connection to MySQL server at 'reading initial communication packet', system error: 0
- Lost connection to MySQL server at ‘reading initial communication packet', system error: 0
- SQL Error (2013): Lost connection to MySQL server at 'waiting for initial communication packet', sys
- Lost connection to MySQL server at ‘reading initial communication packet
- Lost connection to MySQL server at ‘reading initial communication packet’, system error: 111
- Lost connection to MySQL server at 'reading initial communication packet', system error: 111 (MySQL
- mysql报错:Lost connection to MySQL server at 'reading initial communication packet'
- 有关Mysql出现Lost connection to MySQL server at 'reading initial communication packet', system error: 0的一个解决方案
- MySQL error: 2013, “Lost connection to MySQL server at 'reading initial communication packet', syste
- Lost connection to MySQL server at ‘reading initial communication packet
- Lost connection to MySQL server at 'reading initial communication packet' 错误解决
- MySQL远程连接丢失问题解决方法Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- 连接mysql出现Lost connection to MySQL server at 'reading initial communication packet', system error: 0
- Lost connection to MySQL server at ‘reading initial communication packet', system error: 0 mysql远程连接
- 遇见Lost connection to MySQL server at 'reading initial communication packet',system error:0的解决办法
- mysql Lost connection to MySQL server at ‘reading initial communication packet
- 2013 Lost connection to MySQL server at 'handshake: reading initial communication packet'