Correct Database settings for pushing a Drupal site live I have a Drupal 7 site.

I have it working fine on localhost and my own test domain, with individual settings folders setup such as:

sites/localhost
sites/test.mydomain.co.uk

I am now putting it up onto a site where there is no domain set, but I can access it by visiting:
sitename.org/folder1/folder2

i have duplicate settings files in;
sites/folder1.folder2
sites/www.upcomingfinaldomainname.com

Have I got these right?

I keep getting the message:

PDOException: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in db_table_exists()

I'm using the user and pass I have been provided, and the correct db names. I have also set host as localhost and removed the port number.

Any suggestions?
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.