天空小小岛技术网站

标题: Lost connection to MySQL server at 'reading initial communication packet' [打印本页]

作者: 八号    时间: 2011-6-1 22:36
标题: Lost connection to MySQL server at 'reading initial communication packet'
MySQL Server Error:
Lost connection to MySQL server at 'reading initial communication packet'

网上很多人说原因为mysql反向解析域名时出错需要在mysql 配置文件中加
  1. skip-name-resolve
复制代码
另外的原因一、

实际碰到一个用户 程序从一台 windows 迁移到 linux 后

程序中的数据库连接的 host 仍填的 windows 那台的内网的ip

而其数据库则在 linux 那台本机上(应为 localhost) 而导致的出现的此错误,

所以出现此错误时可以先检查一下 数据库连接信息是否正确 (简单来说就是填错host了)

原因二、

因为临时文件夹文件数过多,可能php 不断的在生成session文件导致,需要清理临时文件夹文件,将php的session生成目录更换到其它目录




欢迎光临 天空小小岛技术网站 (http://tkxxd.net/) Powered by Discuz! X3.1