开发者

Regular SQL/php error

开发者 https://www.devze.com 2023-01-02 01:17 出处:网络
I have been creating a new website and am new to all this. Every so often, I get the following error and after a while, it goes away and the web开发者_StackOverflow中文版site comes back?

I have been creating a new website and am new to all this. Every so often, I get the following error and after a while, it goes away and the web开发者_StackOverflow中文版site comes back?

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (11) in /home/gamepla3/public_html/include/database.php on line 16 Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (11)

Could anyone shed any light on the problem I have here? Sorry if the question is vague, I possibly don't understand what you would need to know. Thanks


You seem to have a problem with your MySQL server. Next time, check if you can connect to your database with your MySQL client, and if not, check your MySQL logs.


You need to submit operating system, so the diagnostic test for can be thought of.

1. Check if the daemon for MySQL (you shoudl find mysqld in your process list) is running.
2. What is the port no on which the daemon is operating, have you installed something else which is requiring the same port no.


If it works sometimes and not others (without intervention) then the primary cause is not your code.

You need to verify:

1) That the database was running at the time of the outage

2) That the max connections had not been exceeded

Probably the best way to go about this would be to write your own error handler which could check the process list and the permissions on the socket file at the time of an outage - and make sure the mysql error logging is set up and configured correctly.

C.

0

精彩评论

暂无评论...
验证码 换一张
取 消