drush SQLSTATE[HY000] [2002] No such file or directory 1

drush SQLSTATE[HY000] [2002] No such file or directory

$databases['default']['default'] = array (
  'database' => 'drupal',
  'username' => 'root',
  'password' => 'root',
  'prefix' => '',
  'host' => '127.0.0.1',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
  'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',
);

Here is what the above code is Doing:
1. We’re telling Drupal to use the MySQL database driver.
2. We’re telling Drupal to use the MySQL database named drupal.
3. We’re telling Drupal to use the MySQL user named root.
4. We’re telling Drupal to use the MySQL password root.
5. We’re telling Drupal to use the MySQL host 127.0.0.1.
6. We’re telling Drupal to use the MySQL port 3306.
7. We’re telling Drupal to use the MySQL socket /Applications/MAMP/tmp/mysql/mysql.sock.

Now, let’s save the file and exit the editor.

Next, we need to tell Drupal to use the settings.php file we just created. To do this, we need to create a symbolic link from sites/default/settings.php to sites/default/default.settings.php.

To create the symbolic link, we can use the ln command.

ln -s sites/default/default.settings.php sites/default/settings.php

Now, let’s test our settings.php file by visiting the Drupal site in our web browser.

http://localhost:8888/drupal

If everything is working correctly, you should see the Drupal installation screen.

Now, let’s click on the Save and continue button.

On the next screen, we’ll see a message telling us that we need to create a settings.local.php file.

Let’s click on the link to create the file.

Next, we’ll see a message telling us that we need to create a services.yml file.

Let’s click on the link to create the file.

Now, let’s click on the Save and continue button.

On the next screen, we’ll see a message telling us that we need to create a settings.local.php file.

Let’s click on the link to create the file.

Next, we’ll see a message telling us that we need to create a services.yml file.

Let’s click on the link to create the file.

Now, let’s click on the Save and continue button.

On the next screen, we’ll see a message telling us that we need to create a settings.local.php file.

Let’s click on the link to create the file.

Next, we’ll see a message telling us that we need to create a services.yml file.

Let’s click on the link to create the file.

Now, let’s click on the Save and continue button.

On the next screen, we’ll see a message telling us that we need to create a settings.local.php file.

Let’s click on the link to create the file.

Next, we’ll see a message telling us that we need to create a services.yml file.

Let’s click on the link to create the file.

Now, let’s click on the Save and continue button.

On the next screen, we’ll see a message telling us that we need to create a settings.local.php file.

Let’s click on the link to create the file.

Next, we’ll see a message telling us that we need to create a services.yml file.

Let’s click on the link to create the file.

Now, let’s click on the Save and continue button.

On the next screen, we’ll see a message telling us that we need to create a settings.local.php file.

Let’s click on the link to create the file.

Next, we’ll see a message telling us that we need to create a services.yml file.

Similar Posts