a little help here with Drupal.
Here is an error message I keep getting.

Message Number 1
Failed to connect to your MySQL database server.
MySQL reports the following message: Permission denied.
Are you sure you have the correct username and password?
Are you sure that you have typed the correct database hostname?
Are you sure that the database server is running?
For more help, see the Installation and upgrading handbook.
If you are unsure what these terms mean you should probably contact your hosting provider.

My response is:

1. I have used the correct username and password.

2. I have set up all the GRANTS for the username;
mysql -umydrupal -pcatwhiskers
USE mydatabase
| Grants for mydrupal@localhost |
| GRANT USAGE ON *.* TO 'mydrupal'@'localhost' IDENTIFIED BY PASSWORD '*7BC6060EEE2453F724B253CD31E8E644F862898E' |

I set up all from the console. When I go back to the gui (Linux - Slackware 13.37 - 64 bit version)
and I run the install.php I recieve the message above (number 1).

I have made an adjustment in httpd.conf and commented out mod_rewrite.
I set permissions on session.php as per instructions.

root@lollipop:/srv/httpd/htdocs/sites/default# ls settings.php -l
-rw-r--rw- 1 root root 10310 Apr 30 15:07 settings.php

As I am learning and this is not a production server and is only vulnerable to my stupidity I have not
changed the group or user.

Please help me, it has to be something simple I am missing and it is probably absurdly obvious.



John_B’s picture

[deleted, I did not read the post properly, will look again]

OK, not sure but the list of privileges may be incomplete. See http://drupal.org/documentation/install/create-database
I just grant ALL.

It is easier with a GUI db admin tool!

Sometimes it is easy to overlook that mysql is not running or there is a typo, there have been threads before where it happened, and I have done the same...

midlandman’s picture

Hi John_b,
I followed your advice and gave the user I created ALL grants. As for mysql not running I have kept
a command line window open to watch the activity and msqld and mysql run and do not falter.

I am now scrutinizing the configuration files for Apache and PHP to see if I missed something. Thanks for responding.


John_B’s picture

This is not an Apache problem (though a couple of simple Apache errors on a manual Drupal install are also common), it is exactly as it says a failure to log in to mysql (as far as my experience of numerous Drupal install goes). These mysql problems can be tricky, but if you can get in to mysql with command line it should work. Probably some simple error, we all suffer from that sometimes...

As you are familiar with command line, I highly recommend drush, once you get Drupal working. It is the reliable alternative to script installers (which are best avoided) for a one-click drupal install
('drush make' should install Drupal), as well as doing numerous simple and advanced Drupal things very quickly.

TBH I prefer a GUI such as Virtualmin (or cPanel) + phpMyadmin. Makes everything effortless.

midlandman’s picture

Thank you,

There is no error in using the database name or username and password on my part. The POST does not include anything more than locale and profile, no other information is reaching the install.php file called. I have examined my Apache logs and can find no fault. Perhaps I am entering the information in a way that the program finds unacceptable. - - [05/May/2012:09:53:12 -0700] "POST /install.php?profile=default&locale=en HTTP/1.1" 200 6608

However, I do believe that the fault lies in the MySQL database itself since I discovered no grants are applied to the user 'mydrupal'; so I will investigate that further. This is somewhat unusual and I may have to start with a fresh MySQL install.


midlandman’s picture

I have taken care of the issues I had with MySQL and now have made a database and have given two users the GRANTS as per the MySQL.txt file. The results are not an improvement, and in fact I still have the problem setting up Drupal.

My machine is a 'localhost' and networking is turned off to isolate the machine.

I am able to log in on any of the users I have created from the command line.

These users are able to do the things they are restricted to doing.

I am at a loss what to do next.

All other functions are as per instructions but I still recieve a permission denied.

If your still there,


John_B’s picture

I am only guessing. But logic says if you can log in to the db from cli, and command line cannot, there is a problem with the way php connects to the db. So maybe something to do with the way you have set up the server stack. You could of course test this by testing mysql_connect() in php.

If on the other hand you started work with a server stack which works perfectly well with other php-driven CMSs, such as Wordpresss, then we do seem to be facing a Drupal problem....

There are enough good one-click install options for a server stack that this aspect of getting Drupal running should not be a problem on a local machine, though on a high-traffic production server you might want a more customised setup.