I solved the problem by forcing mysql_connect() to create a new connection each time.
But when you are running a large multi-user service with thousands of users its always possible that one of them will look at your files and take a note of the passwords you have in them.For details, see: too many connections issue can be due to several problems.1. This can tie up many connections and is not really needed for My SQL as new connections are really fast.2.Apache children are hanging around for too long - combine this with pconnect and you have recipe for disaster.The file of your database should contain the following lines:default-character-set=utf8default-collation=utf8_general_ci It means that your database is created to use the utf8 characterset. I have frequent problems with PHP being unable to connect to My SQL after periods of extreme DB activity.One way to accomplish this is: CREATE DATABASE my_database DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; Then, after connecting to it from PHP you should use:mysql_set_charset("UTF8", $connection); If you don't do this, you will get ugly problems in case other software is reading and writing to the same database!!!!!! Long story short, it was because I was not running mysql via named-pipes and Windows was running out of available ports to serve PHP.