I'm new to Drupal, and new to MySQL for that matter. I want to setup a Drupal personal blogging site, and downloaded the Drupal software to try it out.
I did a fresh install of CentOS Linux, included MySQL, PHP, and Apache in the program installation options; enabled the mysqld service after the install finished, and made sure Apache was running too.
After downloading and untarring the Drupal software, I moved all files per the Drupal install instructions into /var/www/html.
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''
MySQL installed a "mysql" user; and I added a "dba_user" user account. I've tried logging in using all three users (mysql, dba_user, and root) and haven't been successful with any of them.
What could I be doing wrong? It's probably a simple thing. I'm very new to both Drupal and MySQL, so I could be missing something very basic.
The version numbers of PHP, Apache, MySQL, and Drupal I'm using are
php 4.3.9-3.2 mysql 4.1.7-4 httpd 2.0.52-9 Drupal 4.6
Paul
techlists@comcast.net wrote:
After downloading and untarring the Drupal software, I moved all files per the Drupal install instructions into /var/www/html.
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''
The 'dba_user' is used in the example, but you'd probably want to use the MySQL 'root' account when setting up the drupal database.
From INSTALL.txt:
"In the following examples, 'dba_user' is an example MySQL user which has the CREATE and GRANT privileges. Use the appropriate user name for your system."
regards,
Torgeir
Torgeir Berg wrote:
techlists@comcast.net wrote:
After downloading and untarring the Drupal software, I moved all files per the Drupal install instructions into /var/www/html.
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''
The 'dba_user' is used in the example, but you'd probably want to use the MySQL 'root' account when setting up the drupal database.
From INSTALL.txt:
"In the following examples, 'dba_user' is an example MySQL user which has the CREATE and GRANT privileges. Use the appropriate user name for your system."
regards,
Torgeir
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.
Paul
On Sun, 24 Apr 2005, Paul Greene wrote:
Torgeir Berg wrote:
techlists@comcast.net wrote:
After downloading and untarring the Drupal software, I moved all files per the Drupal install instructions into /var/www/html.
I ran the next line in the installation instructions:
mysqladmin -u dba_user -p create drupal
^ I think the error is here. mysql does not like spaces.
try: mysqladmin -udba_user -p create drupal
And maybe you should name your database not drupal but after the site you are going to create.
Cheers, Gerhard
Paul Greene wrote:
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.
MySQL has it's own user database. On most standard MySQL setups the superuser is 'root' with no password initially set.
mysqladmin -u root create name_of_db
hth
Torgeir
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@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
El Domingo, 24 de Abril de 2005 21:43, Eric Scouten escribió:
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
I really discourage this. If someone in the machine reads your .bash_history (asuming you use bash), or runs px in the machine, can steal your password.
In all mysql versions I've used, running just "-u foo -p" will ask your password interactively, solving the problem from above.
Torgeir,
please take some time to study MySQL installation. Unfortunately, carelessness here can lead to serious security vulnerabilities in your installation. Time spent here can save many hours of frustration, your data, and more.
I find that the documentation at http://www.mysql.com is pretty good.
Generally, if you use MySQL for Drupal *ONLY*, you should configure your installation so that MySQL is not accessible except from the localhost (assuming Drupal, MySQL and webserver all on the same machine)
This requires the proper configuration of the MySQL users table, MySQL server configuration, firewall settings.
Make sure that you have the most recent version of MySQL installed.
Make sure that you have a *good* MySQL root password setup.
From your post, it sounds as if you have set up a system account 'dba_user'. This is probably a bad idea, if you've done so, it's probably a good idea to remove this account.
On 24 Apr 2005, at 1:57 PM, Alejandro Exojo wrote:
El Domingo, 24 de Abril de 2005 21:43, Eric Scouten escribió:
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
I really discourage this. If someone in the machine reads your .bash_history (asuming you use bash), or runs px in the machine, can steal your password.
In all mysql versions I've used, running just "-u foo -p" will ask your password interactively, solving the problem from above.
-- Alex (a.k.a. suy) - GPG ID 0x0B8B0BC2 http://darkshines.net/ - Jabber ID: suy@bulmalug.net
Good advice, in general! Don't type sensitive information on the command line.
Hope this helps.
Djun
-- puregin@puregin.org
Thanks to Eric, Torgeir, Alejandro, Djun, and Gerhard,
Between your comments, and a "MySQL in 24 Hours" book, I got the databases created, and added a couple of user accounts; one with full privileges, and one with select and insert (is select and insert enough privileges to give a regular user?).
I do intend to put this online at some point, so security is a concern.
Thanks,
Paul
Eric Scouten wrote:
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@localhost identified by"secret"; Query OK, 0 rows affected (0.22 sec)
mysql> exit; Bye $ mysql -u whoami -psecret mysiteThe "grant all" command creates a new user and password and grants that user all permissions on the specified database.
Hope this helps...
-Eric
On Apr 26, 2005, at 4:27 PM, Paul Greene wrote:
Between your comments, and a "MySQL in 24 Hours" book, I got the databases created, and added a couple of user accounts; one with full privileges, and one with select and insert (is select and insert enough privileges to give a regular user?).
I've set up numerous Drupal sites, and have never created more than one user (with full privileges). That's all you will ever need if you are just running Drupal.
Andrew
------------------------------------------------- Andrew Michael Cohill, Ph.D. Information architect
Design Nine provides technology master planning services, community network planning, technology audits, and telecommunications project management to communities and organizations trying to make wise technology and telecommunications expenditures. Design Nine represents the interests of the organization or community, rather than the interests of vendors.
Visit the Design Nine News page for frequently updated news and commentary on technology issues. http://www.designnine.com/news/
Design Nine, Inc. http://www.designnine.com/ Blacksburg, Virginia Voice: 540.951.4400 Cell: 540.320.4406
On 26 Apr 2005, at 3:51 PM, Andrew Cohill wrote:
On Apr 26, 2005, at 4:27 PM, Paul Greene wrote:
Between your comments, and a "MySQL in 24 Hours" book, I got the databases created, and added a couple of user accounts; one with full privileges, and one with select and insert (is select and insert enough privileges to give a regular user?).
The user associated with the Drupal database will require update and delete privileges as well, I think, at a minimum. Someone closer to the database could probably give a more definitive answer.
I've set up numerous Drupal sites, and have never created more than one user (with full privileges). That's all you will ever need if you are just running Drupal.
This is probably dangerous, from a separation of privileges perspective. The point is that if your Drupal installation is compromised, then the attacker could at a minimum drop your database, and in fact create much more havoc by an escalation of privileges attack of the type which just forced the recent security upgrade of MySQL (You have upgraded, haven't you?)
In fact, it would be best to limit delete, insert, update privileges to tables that actually need to have rows deleted, inserted, updated by Drupal. That way, even if Drupal is cracked, at worst your content will be destroyed or defaced. Of course you should have regular backups :)
Andrew
Regards, Djun