I have created a site in Drupal 7 on my local machine. This is my first time working with Drupal and am using the Aquia Drupal stack to run my local site.

My goal: Migrate site to my new production url
Steps taken so far:
1. Exported local DB
2. Uploaded site files to new host domain
3. Created DB on new host and imported DB exported from local
4. Changed settings.php file to point to new DB and uploaded file (overwriting the existing one)

These are the normal steps to migrating a site, however when I go to my url I get the following error:

PDOException: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 110 in lock_may_be_available() (line 165 of /home/u2psm40/sjreformed.org/includes/lock.inc).

I think the error may lie in the settings.php file but am not sure.
Any help would be much appreciated,
Jeremy

Comments

hkprazt’s picture

I got that too, please contact your webhosting provider, it seems they didn't turn on php PDO Function.
I was contacting my webhost provider to turn on PDO function, now the message is gone.
But still get WSOD, dont know why, still looking for clues.

Got clues: my Hosting still use PHP 5.2 and i have active modul Galerie which require PHP 5.3, i'm disabling this module and works fine now...
Check out my site: http://www.gbihome.com and http://www.smakstlouis81.com

johnny-j-hernandez’s picture

Hi all,

I'm having a similar problem. I've setup drupal 7 site on my local and have a custom theme and a few modules setup. Got to a point where I wanted to migrate the site to production for client review but I can not get into any admin page, or and page beyond the front page. I get a 500 Internal Server Error. My hosting company is godaddy.com and I can't get into the server logs for the site so I'm not clear what the problem is. I followed all the steps to move the site:

Setup DB
Import tables from local DB
Edit settings.php to point to new DB
Run update.php

I've tried this twice with the same results so there's got to be something I'm missing but for the life of me I can't find any clues in any of the docs or forums so far. You can check out my problem here:

http://puravidabybrandt.dogfodder.com/

Front page works fine but sub pages all through 500 error.

hkprazt’s picture

Hi johnny, have you check ur setting.php configuration?
try change this line :
# $base_url = 'http://www.example.com'; // NO trailing slash!
to:
(remove the '#' sign in front of the line)
$base_url = 'http://puravidabybrandt.dogfodder.com'; // NO trailing slash!

and check your server php with phpinfo()

the mostly worked php config :
max_execution_time = 300
max_input_time = 300
memory_limit = 128M
post_max_size = 50M
upload_max_filesize = 50M

it works for me....
check my sites : http://www.gbihome.com and http://www.smakstlouis81.com

luke adams’s picture

i found that i had changed my hostname via webmin settings and dns, however the changes didn't filter all the way down, simply needed to update the database settings in the settings.php to reflect : 'host' => 'NEW_HOST_NAME.wherever',

grosza’s picture

I had this same issue moving D7 from development to production, both an upload of the development site and a clean install. Hours of frustration.

The apache error logs recorded multiple instances of this error:
Option Multiviews not allowed here

My problem was solved by simply commenting out line 17 of .htaccess
#Options -Multiviews

Another suggestion was to edit the apache2 config file to allow the multiviews override as suggested here:
http://kitt.hodsden.org/blog/2011/01/drupal_7_multiviews_error_fix

Hope this helps!

woop_light’s picture

same exact problem with only seeing the front page. i can see the homepage but get a '500 internal server error' everywhere else. did you figure this out?!

EDIT: figured out the problem for me. i needed to disable clean urls before exporting the localhost version of the database, then re-enable clean urls after uploading the database to the web server.

develcuy’s picture

That's it, I have just change the IP to "localhost" in the database settings. My system is a Ubuntu Natty with php5.2

ervin.mathieu’s picture

this one works for me... thanks

N4R4YAN’s picture

where is exactly that i have to change this parameter?
It's my first site i am switching to production and i feel a bit confused here.

scott m. sanders’s picture

I got the PDOException above. It was a firewall issue.

Either poke a hole for 3306, or disable your firewall entirely.

boyoboy18’s picture

Even I followed all the steps and getting following error:
PDOException: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in lock_may_be_available() (line 164 of lock.inc).

Could you please re-confirm what need sto be changed in the settings.php and also if hosted on godaddy, what is the SQL port number.

Thanks,
Abhishek

jgdc’s picture

I'm having the same problem as the original one posted in this thread. I uploaded my database and files but I am still getting the following error:
PDOException: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in lock_may_be_available() (line 167 of /data/9/1/35/105/1198920/user/1277392/htdocs/testsite/xampp/htdocs/drupal/includes/lock.inc).

Does anyone know if it might be a problem with the version of MySQL or PHP that I am running and the one that my hosting on network solutions is running? Any ideas on changing settings.php? I've set it to point to the correct database and all but I can't figure out why the site isn't loading up.

Any help would be much appreciated. Thanks!

crispin’s picture

If you are using the DAMP stack Aqcuia desktop developer you will have a folder inside /sites - something like xxxxx.localhost with DB settings file of its own. At the bottom are your dev settings ~ after this comment
///////////////////////////////////////////////////////////////////////
// Don't edit anything below this line! //
// This section is autogenerated by Acquia Dev Desktop Control Panel //
///////////////////////////////////////////////////////////////////////
//<@@ADCP_CONF@@>

Your live settings file should be a copy of the default-settings file at: /sites/mylivesite.com/settings.php without this at the bottom

...with your live DB settings at about line 180 something like:

$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'database_name',
'username' => 'database_username',
'password' => 'pa55werd',
'host' => 'localhost OR specificIP ',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);

my /sites folder has different folders for local development, testing and live - something like this:

all
localdev.localhost
default
test.mydomain.com
mydomain.com

does that help?

jocnou’s picture

Do not upload did not work on the server and not shown I think is an error code to a character that is not put right place, thanks anyway for intent
Jocuri noi

jocnou’s picture

Do not upload did not work on the server and not shown I think is an error code to a character that is not put right place, thanks anyway for intent.
Jocuri noi

Alexandru Anghel’s picture

I had the same issue and found out that was from settings.php where instad of 127.0.0.1 in the 'host' it should be 'localhost'. the problem is solved on here.

Don't forget to give solution where you post your questions.

msandles’s picture

I had a very similar issue and found (after hours of searching) that a slight error in how the Port was expressed in the settings.php file solved the problem. If you're not sure, try leaving it blank.

sandipan4uonly’s picture

I had a same issue , I was getting this error message below.

PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in lock_may_be_available() (line 167 of /home/content/80/10109280/html/compareright/includes/lock.inc).

But after reading this article I have solved this problem , There was a problem in host setting .
File location (sites/default/settings.php line no 211 - version : D7)

ks_sudhir’s picture

I used ipage to host my site and realized that for ipage the host needs to be my_database_user.ipagemysql.com. In fact the way I found is if you logon to ipage.com (in my case), go to the MYSQL database link and click on "generate code", it gives you the hostname to use in your settings.php file.

Hope this helps.

Cheers.