I installed a handy little script on a website. When in localhost, there are never any errors; however, when I am hosting it on my VPS, I occasionally and purely randomly get MySQL errors, and I think it is murdering my traffic. Is this happening because of a bad VPS, or are there other reasons?
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean
given in
/home/freetrav/public_html/travian/GameEngine/Database/db_MYSQL.php on
line 1383Lost connection to MySQL server during query
Warning: mysql_connect() [function.mysql-connect]: Can’t connect to
local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) in
/home/freetrav/public_html/travian/GameEngine/Database/db_MYSQL.php on
line 17 Can’t connect to local MySQL server through socket
‘/var/lib/mysql/mysql.sock’ (2)MySQL server has gone away
All these are purely random and none are permanent. They usually happen when there are many pages open at once, and they log the current account out.
Sounds like MySQL is crashing. If you can see the mysqld error logs, that would confirm it.