Correct Database settings for pushing a Drupal site live
If your connection parameters were incorrect, you would get a different error from MySQL.

I have seen connection problems on Drupal systems for a few different reasons.


Overloaded server
Low timeout values on a busy server
Low value for max_allowed_packet (this normally is a 2006 or 2020, though, in my experience).


Assuming other sites work, then the first two likely aren't the problem.  I would check your max_allowed_packet and see if that helps matters.  I typically use 32M; large values can help with restoring backups.