问题:Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
原因:
1.首先定位了问题,是由于访问量太大,导致数据库连接数不够,问题出现在数据库上
2.查找解决方案修改mysql的配置文件my.cnf,调整最大连接数max_connections
解决方案:
一、方案一
修改mysql配置文件my.cnf,在[mysqld]段中添加或修改max_connections值:
max_connections=2000
1.切换到my.cnf所在文件夹
cd /etc/mysql/
2.查看该文件夹下的文件
ls
3. 打开my.cnf文件
sudo vi my.cnf
4.在[mysqld]段中添加
max_connectio

最低0.47元/天 解锁文章
1338

被折叠的 条评论
为什么被折叠?



