玩CSOL的时候经常出这个2013 lost connectionn to server lost…

为什么我家玩csol进图一会儿就弹出个Connection to server lost during level change_百度知道MySQL远程连接丢失问题解决方法(Lost connection to MySQL server)
投稿:junjie
字体:[ ] 类型:转载 时间:
这篇文章主要介绍了MySQL远程连接丢失问题解决方法,Mysql错误Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0解决方法,需要的朋友可以参考下
最近服务器很不稳定,于是重装了mysql 和php 服务,但是接着却遇到了很头疼的麻烦。
远程连接mysql是总是提示:
代码如下:Lost connection to MySQL server at ‘reading initial communication packet', system error: 0
很明显这是连接初始化阶段就丢失了连接的错误。
google半天大多是说的注释掉配置文件中 bind-address = 127.0.0.1 这一句。
但是我的配置文件并没有配置这一句,各种搜索均未果。今天偶然在网上看到一个遇到同样问题的人贴出的配置,发现他多了一句配置 skip-name-resolve,抱着试试看的态度改了一下并重启了mysql服务,果然远程一下子就连接上了,真是无语。
其实问题很简单,都是MySQL的配置文件默认没有为远程连接配置好,只需要更改下MySQL的配置文件即可。
具体的解决步骤如下,希望能帮助遇到同样问题的同学们:
找到并修改my.cnf文件。在不同的Linux系统下,my.cnf放在不同的位置。这里以Ubuntu Server做示例,其他系统请根据情况自行找到my.cnf的路径。一般只会存放在/f或者/etc/f下。
首先用vim打开my.cnf:
vim /etc/f
看看是否有绑定本地回环地址的配置,如果有,注释掉下面这段文字:(在文字之前加上#号即可)
bind-address = 127.0.0.1
然后找到[mysqld]部分的参数,在配置后面建立一个新行,添加下面这个参数:
skip-name-resolve
保存文件并重启MySQL:
代码如下:/etc/init.d/mysql restart
这样就会发现,问题已经解决了!远程连接不会丢失了。
您可能感兴趣的文章:
大家感兴趣的内容
12345678910
最近更新的内容
常用在线小工具玩CSOL时为什么会出现connection to server lost during level change,而且重下过几次都没用(不是很卡)_百度知道&& /usr/openwin/bin/xinit: connection to X server lostSolaris Common Messages and Troubleshooting Guide
/usr/openwin/bin/xinit: connection to X server lost
This means that the xinit(1) program, which sets up X11 resources and starts a window manager, failed to locate the X server process. Perhaps the user interrupted window system startup, or exited abnormally from OpenWindows (for example, by killing processes or by rebooting). It is possible that the X server crashed. Data loss is possible in some cases. Depending on process timing, this message might be normal when OpenWindows exits during a system reboot.
The only solution is to exit and restart OpenWindows. You do not need to reboot the system unless it hangs and fails to give you a console prompt. To exit OpenWindows, select Workspace-&Exit. To restart OpenWindows, type openwin(1) at the system prompt.

参考资料

 

随机推荐