服务器为: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