Web Hosting Talk







View Full Version : MySQL Connection Error


engrkhalid
03-15-2004, 05:58 AM
Hi,

I have one site in this server: P4 / 1G Ram / Linux / Apache / MySQL4 / PHP4

and the site is working fine, but sometimes (about 5%) the following error appear:

----------
Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (2)
----------

Any help please...

Walter
03-15-2004, 07:48 AM
What CPU loads do you see usually?

Is this always at the same time? Maybe you have some background scripts running at certain times (e.g. backup) consuming much CPU cycles?

engrkhalid
03-15-2004, 07:58 AM
Thanks Mr. Walter for you replay,,

The CPU loads is normal and it is always idel 95%-100%
and the backup happen once a day..
So, no thing is consuming the CPU.

And, still I'm facing this problem,, Need your help please..

phpdeveloper
03-15-2004, 10:01 AM
Seems like your MySQL server hangs up. Can you paste here the contents of /etc/my.cnf file?

datums
03-15-2004, 11:49 AM
When this happen see how many mysql connections you have.

engrkhalid
03-15-2004, 01:25 PM
I'm always receiving 4 error messages when that error happen, they are:

syslogd failed @ Mon Mar 15 19:58:00 2004. A restart was attempted automagicly.

mysql failed @ Mon Mar 15 19:57:39 2004. A restart was attempted automagicly.

eximstats failed @ Mon Mar 15 19:57:38 2004. A restart was attempted automagicly.

bind failed @ Mon Mar 15 19:57:22 2004. A restart was attempted automagicly.


the file /etc/my.cnf contain:
[mysqld]
set-variable = max_connections=500
safe-show-database


And I think it is not too many connection error.



I need your help please........

optimumd
04-18-2004, 08:04 PM
I've had this exact same problem. Try removing max_connections in my.cnf. Also lower the wait_timeout and see what happens. Let me know how that works for you.

Steven
04-19-2004, 03:29 AM
what distro of linux?

acctman
01-18-2005, 06:23 AM
did this fix work? i to am experiencing a similar problem