[PDOException] SQLSTATE[HY000] [2002] No such file or directory
Drupal 8 beta 14 installation in Mac OS X 10.7.5
Steps to reproduce: Inside root drupal directory I execute the console, in my case I have called it "drupal" and I receive this message:
[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
What can I do?
@bunset: We got that issue reported on the gitter channel by @Eyal-Shalev:
I encountered the following error when trying to use drupal console with my aquia dev desktop installation of drupal8:
[PDOException]
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I solved it by creating the following symlink:
ln -s /Applications/DevDesktop/mysql/data/mysql.sock /tmp/mysql.sock
May you confirm if this fix your issue too?
Hi The description of my issue is different. It doesn't work for me. But I have good news. I have fixed it by changing server=localhost for server=127.0.0.1 in my setting.php file.
Thanks anyway and kind regards.
We have that fix already on the gitbook http://hechoendrupal.gitbooks.io/drupal-console/content/drupal_console_faq/installation-problems.html
@bunset closing this since fixed.
settings.php: $databases['default']['default'] = array ( ... 'host' => '127.0.0.1', ... );
@jmolivas what if my drupal does not have access to the database? These fixes assumes that DB is up and running. But is it possible to run drupal console without access to the database? For example to generate modules or entities?
Some drupal console commands require an active installation of a drupal site and some don't.
I think that module generation requires a drupal installation.
On Tue, May 10, 2016, 18:34 SiliconMind [email protected] wrote:
@jmolivas https://github.com/jmolivas what if my drupal does not have access to the database? These fixes assumes that DB is up and running. But is it possible to run drupal console without access to the database? For example to generate modules or entities?
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/hechoendrupal/DrupalConsole/issues/845#issuecomment-218196051
Regards, Eyal Shalev
I'm using Vagant. I realize that some commands will need to be run from within Vagrant in order to work, but I thought "drupal check" would at least partially work from within the root drupal directory. Any drupal command fails with [PDOException} from within a Vagrant drupal site.] I'm setting up the remote access configuration which I expect to work, but I thought I'd comment here because I doubt I'm the only one who will run into this.
any way to get drupal console to work more like drush in regards that it can allow for a --uri parameter for remote databases?
I confirm, 127.0.0.1 is better understood then localhost for host value in settings.php.
Thank you!