-4

I am trying to install Drupal on a CentOS based shared server environment (namecheap.com) with mysql, ssh and Composer.

I have created a database username and a database with the same name and a password and granted all user privileges.

I ran:

cd WEB_APPLICATION_ROOT
composer create-project drupal/recommended-project WEB_APPLICATION_DIR_NAME
cd WEB_APPLICATION_DIR_NAME
composer require drush/drush
vendor/bin/drush site:install

I prompted:

 Database name [drupal]:
 > DB_NAME

 Database driver [mysql]:
 > DB_NAME

 Database username [drupal]:
 > DB_NAME

 Database password [drupal]:
 > DB_PASSWORD

 Database host [127.0.0.1]:
 > 127.0.0.1

 Database port [3306]:
 > 3306

 [warning] Program UNKNOWN not found. Proceed if you have already created or emptied the Drupal database.

 > You are about to:
 * Create a sites/default/settings.php file

 Do you want to continue? (yes/no) [yes]:
 > yes

Ouput

[notice] Starting Drupal installation. This takes a while.
[notice] Performed install task: install_select_language
[notice] Performed install task: install_select_profile
[notice] Performed install task: install_load_profile
[notice] Performed install task: install_verify_requirements

In install.core.inc line 971:

Database name field is required. Database username field is required. Resolve all issues below to continue the installation. For help configuring your database server, see the installation handbook, or contact your hosting provider.

  • Failed to connect to your database server. The server repor ts the following message: SQLSTATE[28000] [1045] Access denied for user 'hanekudai'@'localhost' (using passw ord: NO).
    • Is the database server running?
    • Does the database exist or does the database user have sufficient privileges to create the database?
    • Have you entered the correct database name?
    • Have you entered the correct username and password?
    • Have you entered the correct database hostname and port number?

GUI

when I went to example.com/web/ and used the GUI installation with the exact same DB credentials, I have installed Drupal successfully.

My question

What is the problem in Drush installation?

1
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – Clive
    Commented Aug 27, 2022 at 14:04

1 Answer 1

-2

In

 Database driver [mysql]:
 > DB_NAME

I should have prompted

 Database driver [mysql]:
 > mysql

Then the installation finished without error.

Not the answer you're looking for? Browse other questions tagged or ask your own question.