I recently tried to setup a dev environment for my production site and replicated the same architecture.
I've a server hosting Drupal, a second server for mysql and a memcached server. All the setup was good.
- Exported the Prod DB
- Installed Drush
- Made sure the latest code is pulled
run Drush status
Drupal version : 7.37
Site URI : http://default
Database driver : mysql
Database hostname : ip address
Database port : 3306
Database username : username
Database name : dbname
PHP configuration : /etc/php.ini
PHP OS : Linux
Drush script : /usr/local/bin/drush
Drush version : 8.1.9
Drush temp directory : /tmp
Drush configuration :
Drush alias files :
Drupal root : /path/to/root/folder
Drupal Settings File : sites/default/settings.php Site path : sites/default
The issue is when trying to load the website I get :
PDOException: SQLSTATE[HY000]  Can't connect to MySQL server on 'ip-address' (13) in lock_may_be_available() (line 167 of /var/www/cw/html/includes/lock.inc).
Any idea why this is happening ? If I run
drush sqlc I'm able to connect to the remote database.
Any help will be much appreciated.