LNMP中部分php程序无法访问mysql

服务器为:ubuntu

背景:

1、LNMP安装好后程序可以正常使用

2、不小心执行了一下apt-get install mysql-server php5-mysql

3、服务器(LNMP)mysql无法启动,无法创建连接

4、apt-get 清除安装后服务可以启动

现象:

1、基于thinkphp的2个web程序可以正常访问数据库。

2、phpmyadmin和WeCenter的PHP程序无法连接mysql

3、使用mysqldump备份出现

Got error: 2002: Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (111 ) when trying to connect

尝试:

https://segmentfault.com/q/10... 中答案的方法并修改/etc/my.conf配置。使用mysqldump 可以连接了,但phpmyadmin和WeCenter的PHP程序无法连接mysql,账户,密码,数据库都检查了

WeCenter报错:

------
exception 'Zend_Exception' with message 'Can't connect master database: Connection refused' in

XXX/bbs/system/core/db.php:45

阅读 3.1k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题