[英]mysql connection error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Godaddy Cpanel
My website was working fine till yesterday. 我的网站运行良好,直到昨天。 But it suddenly started showing this error:
但是它突然开始显示此错误:
mysql connection error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
mysql连接错误:无法通过套接字“ /var/lib/mysql/mysql.sock”连接到本地MySQL服务器(2)
I don't think I made any changes except adding the site to alexa. 除了将站点添加到Alexa之外,我认为我没有进行任何更改。 I googled this and found a lot of resources but all those couldnt help me because I did not fully understand them.
我搜索了一下,发现了很多资源,但是所有这些都无法帮助我,因为我没有完全理解它们。 I am also not able to locate the file
mysql.sock
. 我也找不到文件
mysql.sock
。
I want to know if my website has been hacked. 我想知道我的网站是否遭到黑客入侵。 Plus, the solution to the problem.
另外,解决问题的方法。
Might want to start with checking all your db configuration and make sure you did not overwrite or accidentally changed something? 可能想从检查所有数据库配置开始,并确保您没有覆盖或意外更改某些内容?
If not that, then try restarting your mysql server. 如果不是这样,请尝试重新启动mysql服务器。 Not sure what Linux env your running, but whichever one it is, Google how to restart mysql.
不知道您正在运行哪种Linux环境,但是无论使用哪种环境,Google都如何重启mysql。
You could also try and restarting apache. 您也可以尝试重新启动apache。 I think the command for that is
我认为命令是
sudo service apache2 reload sudo服务apache2重新加载
sudo service apache2 restart sudo服务apache2重新启动
sudo service mysql restart sudo服务mysql重新启动
Then verify if mysql is running on the socket, run this command to see the process 然后验证套接字上是否正在运行mysql,运行此命令以查看该过程
ps aux | ps aux | grep mysql
grep MySQL的
this is simple. 这很简单。 Run this on commandline
在命令行上运行
mysql -uroot -p -hlocalhost
sudo service mysql restart
mysql -u root -p
I hope that works. 我希望能奏效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.