I have an issue where users on my web site have recently begun to receive the error message:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
I know that the connection strings in the code are correct, as users are able to query the database view pages that retrieve info from and submit user-generated info to the database. This leads me to believe that the error is a result of too many connections open at one time. The code is php, and each php page has itw own mysql_open and mysql_close commands, so I'm wondering if there are too many connections open at one time. I don't know if that's likely, given that there are only 20 people that log into the site on any given day. My question is - how can I tell how many connections are open at any given time, and can I somehow keep track of the # of connections open throughout a random day? I'm relatively new to this, and I'm using phpmyadmin to manage the database. If it is in fact too many connections, what's the best approach to deal with it?
And are there any other possible causes that I'm not yet considering? Basically, there's no predictable way to determine whether or not a user's data will be submitted or whether an error will be returned, which is disconcerting from the user's perspective, to say the least.
This question is closest to my problem but does not provide a solution to fix my specific issue, hence my posting a new question.
Thanks in advance for the ideas.