I am stuck with getting Drush to work properly on my development server. And I am pretty sure the main reason is linked to not being able to connect to my site database.
My setup is as following:
- Website: Drupal 7 (7.23) website running on my personal (Synology) NAS, that is in my LAN.
- PC OS: Windows8
- Drush: Used the Windows Installer (installed version: 5.8).
Drush got installed and is "partially" working, meaning: I can run some general Drush commands (e.g. drush status) and e.g. download modules. But e.g. enabling modules generates errors, I have less options for clearing cache, etcetera.
I know something is wrong with the Drush (configuration), as I get e.g. the following a warning message:
PDO::___construct():  No connection could be made because the target machine actively (trying to connect via tcp://127.0.0.1:3306) environment.inc 517
When I want to retrieve a status overview, I get the following:
Z:\CMV-OpWeg>drush status PDO::__construct():  No connection could be made because the [warning] target machine actively (trying to connect via tcp://127.0.0.1:3306) environment.inc:517 Drupal version : 7.23 Site URI : http://default Database driver : mysql Database hostname : 127.0.0.1 Database username : root Database name : cmv-opweg Default theme : garland Administration theme : garland PHP configuration : D:\System Utilities\Drush\Php\php.ini Drush version : 5.8 Drush configuration : Drush alias files : C:\Users\BD/.drush/aliases.drushrc.php Drupal root : Z:/CMV-OpWeg Site path : sites/default File directory path : sites/default/files
And with some Drush commands the error:
Drush was not able to start (bootstrap) the Drupal database.
From my preparations before getting Drush installed, I noticed in the above code that I am missing three distinct lines in my status overview that I do see referenced when doing some research:
Database : Connected Drupal bootstrap : Successful Drupal user : Anonymous
This is the reason why I started this post with mentioning that I believe there is something wrong with the database connection. However, I do not understand this, as my Drupal site functions fine, which means that the settings in my "settings.php" must be okay.
One might think that these pointers should give ample leads to find a solution. I have gone through the chapter on Drush in "The Definitive Guide to Drupal 7" by Greg Anderson, and I can assure you that I have spend countless hours in the past weeks on getting Drush to work properly on my system by searching the internet high and low on anything I could find on Drush. And yes there are plenty of tutorials to find, plenty of posts from people that have issues that look like mine (but not exactly), but still I have not been able to get it to work, or I am just not seeing it.
What came up a lot is the advice to change the 'host' setting in my "settings.php" from "localhost" to "127.0.0.1.", which I did (as you can see from the status overview above). There were some references to specify the 'port' setting to "3306", which I also tested, but without success.
Now, I can not exclude the fact that perhaps my lack of knowledge and/or experience is a reason that I might be overseeing an obvious reason for my issue. I am fairly new at building sites (with Drupal), and in the past 6 months going through a pretty steep Drupal learning curve. I have read a couple of books on Drupal and started building a site without doing any coding. I came across Drush a couple of times, installed it a few months back, but could not get it to work, so left it as it was. Now I need to start theming my site and wanted to start using the Omega 3 subtheme that I created months back (but not yet really worked with). Now with the new Omega 4 theme out, it makes sense to skip Omega 3 and start with Omega 4. But in order to create a subtheme I need Drush to work, as there is no good documentation explaining the manual process (although I have asked for it). So as you can see, I am in need to get Drush working, which needs to happen anyway, as everything I read about it tells me that I really should start using it. So I could use the help of anybody "listening".
What I should mention also is the the fact that I guess it does not help that I am not an expert on linux, apache, php and working with the command line. From many of the internet posts that I have read I must conclude that I am missing a lot of background knowledge. But I am not giving up yet, and I am willing to learn. The appeal of what Drupal can do is big and most of the time I am enjoying the ride....