[drupal-support] Installation issues

Eric Scouten drupal.org at ericscouten.com
Sun Apr 24 19:43:47 UTC 2005


Paul Greene wrote:

>>> I ran the next line in the installation instructions:
>>>
>>> mysqladmin -u dba_user -p create drupal
>>>
>>> It prompted for a password; I entered a password and got the following
>>> response:
>>>
>>> mysqladmin: CREATE DATABASE failed; error: 'Access denied for user
>>> ''@'localhost' to database 'drupal''

> How do you create a user in MySQL? (let me reiterate I'm just as new at 
> MySQL as I am at Drupal).
> 
> Or does MySQL use operating system level user accounts? I've tried 
> "mysql", "dba_user", and "root" and none of them have worked. MySQL only 
> added the "mysql" account on its own.

As Torgeir said, MySQL maintains its own list of user accounts that is 
unrelated to the Unix system's user accounts.

If you've been given a username and password by someone else who runs 
the MySQL server, you *must* put a space between the -u and the user 
name and you must *not* put a space between the -p and the password. 
(Yes, I know this is confusing.) Thus:

    $ mysql -u whoami -psecret drupal

assuming username "whoami", password "secret", database name "drupal".

If you are running your own machine, you probably have root access to 
MySQL which you can then use to create new MySQL accounts. It would look 
something like this:

     $ mysql -u root

     mysql> create database mysite;
     Query OK, 1 row affected (0.04 sec)

     mysql> grant all on mysite.* to whoami at localhost identified by 
"secret";
     Query OK, 0 rows affected (0.22 sec)

     mysql> exit;
     Bye

     $ mysql -u whoami -psecret mysite

The "grant all" command creates a new user and password and grants that 
user all permissions on the specified database.

Hope this helps...

-Eric



More information about the drupal-support mailing list