简体   繁体   English

mysql连接错误:无法通过套接字'/var/lib/mysql/mysql.sock'连接到本地MySQL服务器(2)Godaddy Cpanel

[英]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.

相关问题 无法连接:无法通过套接字“ /var/lib/mysql/mysql.sock”连接到本地MySQL服务器(2) - Could not connect: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Wordpress中的MYSQL连接问题-无法通过套接字'/var/lib/mysql/mysql.sock'连接到本地MySQL服务器(2) - Issue with MYSQL connection in Wordpress - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) err_connection_timed_out 和 PHP 警告:mysqli_connect():(HY000/2002):Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' - err_connection_timed_out and PHP Warning: mysqli_connect():(HY000/2002):Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' Magento错误:SQLSTATE [HY000] [2002]无法通过套接字'/var/lib/mysql/mysql.sock'连接到本地MySQL服务器 - Magento Error: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' ERROR 2002 (HY000): 无法通过 socket '/var/lib/mysql/mysql.sock' (13) Ubuntu 连接到本地 MySQL 服务器 - ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) Ubuntu 无法通过套接字'/tmp/mysql.sock'(2)错误连接到本地MySQL服务器 - Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error 警告:mysql_connect():无法通过套接字“ /tmp/mysql.sock”连接到本地MySQL服务器(2) - Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Mac 上的 Django + XAMPP(2002,“无法通过套接字'/tmp/mysql.sock'(2)连接到本地 MySQL 服务器”) - Django + XAMPP on Mac (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)") MySQL服务器崩溃且无法启动-无法通过套接字'/tmp/mysql.sock连接到本地MySQL服务器 - MySQL Server crashes and fails to start - Can't connect to local MySQL server through socket '/tmp/mysql.sock Mac Terminal / MySQL配置问题| 错误2002(HY000):无法通过套接字'/tmp/mysql.sock'连接到本地MySQL服务器(2) - Mac Terminal/ MySQL configuration issues | ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM