It's probably just mysql exceeding the max number of connections so it's throwing that error. The max connections can be changed, but would require root access to the server and if you're hosted somewhere then your host may not raise the max connections for you, but you could always ask and find out.
If you're script is using persistant connections, that could possibly be causing you to exceed the max connections so turning them off may help.