Hi,

During the "Set up database" phase of installation, I get the following error:

Failed to connect to your database server. The server reports the following message: SQLSTATE[28000] [1045] Access denied for user 'drupal_a2z'@'web8.hosting.digiweb.ie' (using password: YES).

MySQL db name: drupal
username: a2z

Entry:
Database name: gerardo_drupal
Database username: drupal_a2z

Can someone point out where I'm going wrong?

Comments

John_B’s picture

it usually turns out someone made a typing mistake setting up the db user name or name or password. create database user or database user's password again

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

drupaldeeduper’s picture

I've double checked the login details and the spelling is correct.

Any other suggestions?

John_B’s picture

Maybe mysql recognizes the user but that user has not been granted sufficient rights on the database. You do not say how you set up the database.

So here is how you prove to yourself this is not a Drupal problem. If you 'know' your database user name and password are correct you will be able to connect to the database using those credentials in phpmyadmin, or via command line.

for example from a shell window do
mysql -u username -ppassword databasename

(no space after -p, replace username, password and databasename with your user name, password, and database name)
If you get an access denied message now that proves you have wrong user name or password and the problem has nothing to do with Drupal. If you can connect this way but not in Drubal with the same credentials, you have discovered a new bug in Drupal.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

drupaldeeduper’s picture

Yes I forgot to mention,

It's a MySQL database with a single dba user and I can connect directly using phpMyAdmin using the username gerardo_a2z and the correct password.

I'm also using the following advanced settings:

Database host: mysql2.hosting.digiweb.ie
Port: 3306

John_B’s picture

I don't know. Any idea why you are getting web8.hosting.digiweb.ie when you db server is mysql2.hosting.digiweb.ie? Something wrong there somewhere. Did you enter you backend database settings in settings.php? I have never set this up, so not the best person to advise, but I think you have to. Maybe google gives some guidance....

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

drupaldeeduper’s picture

I'm not too sure.

I've been contacting my host, but nothing fruitful has emerged yet.

Does anyone have any ideas?

John_B’s picture

It might be useful to know why you have your db on a separate server. Unless you are running a heavy-traffic site where you really need this, I would be tempted to move hosts. But if you prefer to use a host who uses separate db server, the first thing to look at is probably the db user permissions: see this post http://drupal.org/node/262393#comment-856881

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

M.yusuf.Wibowo’s picture

SQLSTATE[HY000]: General error: 1 no such table: block_custom

ahmed.alaya’s picture

I was having the same problem!!
Drupal is too lazy! what you have to do, is to create manually a DB, and you put the good Login and Password when you install Drupal!
it woooorks!

Druper’s picture

After having set up the DB and user with access via localhost and pounding my head over why D8 would stall with the cannot connect error, I tried changing the host to 127.0.0.1 (for which the user did NOT have privileges!)

Bingo, it worked. Go figure.

asb’s picture

The suggestion from Druper worked for me on an installation with local (!) database server. With such a basic setup it has never been necessary to replace 'localhost' (default setting) with '127.0.0.1' (IP address for localhost).

Another issue which caused me a lot of headache are setups with a remote database server - mysterious "access denied" errors. The solution is often very simple: By default, mysqld blocks a host after 10 connection errors. This limit is quickly reached, e.g. when you restore a backup which points to a different server or uses different credentials. To resolve this, you can do a mysqladmin flush-hosts.

prasannah.ganeshan’s picture

I am probably too late to this topic.

I had encountered the same problem, but very recently. I had MySQL Workbench installed so setup the database. My environment was Xampp, MySQL Workbench and Drupal 7.

When I created another user with PhMyAdmin it wokred. I think it's probably something to do with the version of Workbench I had installed.

ramesh_singh’s picture

i think you are missing the database password while installing the drupal in LAMP server.

mmjvb’s picture

The other replies suggest issues on MySQL level. The security in MySQL uses the format user@host. When using the name localhost as host, it requires you to have 127.0.0.1 localhost in your host file. MySQL considers user@127.0.0.1 different from user@localhost.
Which is why on the windows platform you have three different users: root@127.0.0.1, root@::1, root@localhost.

So, your underlying infrastructure needs to be properly configured and upon install you need to provide correct information. When it doesn't work there is something wrong! Either a typo or bad configuration.

Lovejit_singh’s picture

In my MacBook, I have installed MAMP then after some time I got it that the password I entered was wrong. In MAMP, mysql Password is also set as "root" .