I'm a newbie when it comes to drupal and MySQL, but I've been developing software under unix/linux for 20 years. I'm running Fedora Core 4.0, MySQL 4.1.11, and installed drupal 4.6.5. I followed all of the steps to setup the initial user's list in MySQL, and the steps to create a drupal mysql user and database. I have set $db_url in sites/default/setting.php to:
Mysql://drupalusername:drupalpassword@fullhostname/drupaldatabasename
I've set:
$base_url="http://fullhostname";
Of course these values are changed for the e-mail, but they are the correct values as the names imply.
The problem I have is when I point my browser to the drupal directory, I get the following error in the browser window:
Access denied for user 'drupaluser'@'fullhostname' (using password: YES)
I can view a test index.html in the web root directory, so I know apache is up and running. I get do a "mysqladmin version --password=rootpassword" to talk to the mysqldemon and that is running. The basic mysql test show the databases are there.
Considering I did not get any errors while configuring everything, I must have misunderstood something. I realize there are probably hundreds of things that I could have done wrong, but can I get some pointers or things to try? I've double checked everything several times.
Any help would be greatly appreciated!
Regards, Kory
On Saturday 11 February 2006 14:59, Kory Hamzeh wrote:
Mysql://drupalusername:drupalpassword@fullhostname/drupaldatabasename
I've set:
$base_url="http://fullhostname";
Of course these values are changed for the e-mail, but they are the correct values as the names imply.
The problem I have is when I point my browser to the drupal directory, I get the following error in the browser window:
Access denied for user 'drupaluser'@'fullhostname' (using password: YES)
I can view a test index.html in the web root directory, so I know apache is up and running. I get do a "mysqladmin version --password=rootpassword" to talk to the mysqldemon and that is running. The basic mysql test show the databases are there.
Considering I did not get any errors while configuring everything, I must have misunderstood something. I realize there are probably hundreds of things that I could have done wrong, but can I get some pointers or things to try? I've double checked everything several times.
Any help would be greatly appreciated!
Regards, Kory
Some things to try:
Is the "Mysql://" part of the connection string capitalized like that? It may be case sensitive (I'm not sure).
Can you log in on the console to that specific MySQL user? Try:
mysql -u drupaluser -h fullhostname -p drupaldatabasename
Enter the password when prompted. (The -p tells it to ask. You can also use -pdrupalpassword, note the lack of a space, to specify it on the command line.) Make sure you do that from the computer where Drupal itself is running, if it's different than the database server.
If you can't log in that way, then the problem is with the MySQL user. You may need to login to MySQL as root and enter "Flush Privileges" (that actually saves your changes), or the user may be misconfigured. There's a lot of things that can be wrong with a MySQL user. :-)
If that does work, try a test PHP script that does nothing but connect to the server, open the database, and run a simple select. If that doesn't work, then the issue is PHP, not Drupal itself. If that does work, then the issue is with Drupal, and I'm out of suggestions at the moment. :-)
Is the "Mysql://" part of the connection string capitalized like that? It may be case sensitive (I'm not sure).
It's not capitalized -- my MUA changed it.
Can you log in on the console to that specific MySQL user? Try:
Yes, I can do a linux login as mysql and the password. I did not create this account, this was created by fedora or the mysql install script.
mysql -u drupaluser -h fullhostname -p drupaldatabasename
This does NOT work. However, if I replace fullhostname with localhost, it does.
Does that give you any clues?
Regards, Kory
On Saturday 11 February 2006 12:59 pm, Kory Hamzeh wrote:
I'm a newbie when it comes to drupal and MySQL, but I've been developing software under unix/linux for 20 years. I'm running Fedora Core 4.0, MySQL 4.1.11, and installed drupal 4.6.5. I followed all of the steps to setup the initial user's list in MySQL, and the steps to create a drupal mysql user and database. I have set $db_url in sites/default/setting.php to:
Mysql://drupalusername:drupalpassword@fullhostname/drupaldatabasename
If your database is on the same computer as the Web server, you probably want "localhost" instead of "fullhostname".
$db_url = 'mysql://drupalusername:drupalpassword@localhost/drupaldatabasename';
If your database is on a different computer, your grant permissions were probably not set to allow the remote Web server to access the database.
GRANT ALL PRIVILEGES ON drupaldatabasename.* TO drupalusername@fullhostname IDENTIFIED BY 'drupalpassword';
I suspect you want the first solution rather than the second.
I've set:
$base_url="http://fullhostname";
Of course these values are changed for the e-mail, but they are the correct values as the names imply.
The problem I have is when I point my browser to the drupal directory, I get the following error in the browser window:
Access denied for user 'drupaluser'@'fullhostname' (using password: YES)
Jason,
Mysql://drupalusername:drupalpassword@fullhostname/drupaldatabasename
If your database is on the same computer as the Web server, you probably want "localhost" instead of "fullhostname".
$db_url = 'mysql://drupalusername:drupalpassword@localhost/drupaldatabasename';
It works now!! Thank you.
If your database is on a different computer, your grant permissions were probably not set to allow the remote Web server to access the database.
GRANT ALL PRIVILEGES ON drupaldatabasename.* TO drupalusername@fullhostname IDENTIFIED BY 'drupalpassword';
I did issue the above command, except the MySQL doc stated to use '%" instead of the actual host name. Did I misunderstand something?
Anyway, its working and I'm very happy!
Regards, Kory
On Saturday 11 February 2006 16:19, Kory Hamzeh wrote:
GRANT ALL PRIVILEGES ON drupaldatabasename.* TO drupalusername@fullhostname IDENTIFIED BY 'drupalpassword';
I did issue the above command, except the MySQL doc stated to use '%" instead of the actual host name. Did I misunderstand something?
Anyway, its working and I'm very happy!
Regards, Kory
I suspect the issue is MySQL's configuration. MySQL can be configured to accept connections only from localhost and nowhere else, and that is the default configuration in many distros. However, defines localhost as "coming from 127.0.0.1" not as "figure out what the real computer is".
So if your computer is named bob.com, then trying to access bob.com will have the kernel send a message out it's outgoing interface, back in its incoming interface, and be reported to any listening deamons (like MySQL) as coming from "some other computer with IP address 1.2.3.4". IF, however, you access localhost, the kernel short-circuits the connection internally and sends it directly to the listening program, something the listing program can detect.
So connecting to bob.com will get MySQL to reject it as being from some foreign computer it can't identify, while localhost it will accept.
The user@% tells MySQL to accept that user from any host, but only AFTER that host has been accepted on its own first. Since it was rejecting the host, it never got around to checking the user.
That's today's Linux lesson, boys and girls. There will be a test later. :-)
On Saturday 11 February 2006 02:19 pm, Kory Hamzeh wrote:
Jason,
Mysql://drupalusername:drupalpassword@fullhostname/drupaldatabasename
If your database is on the same computer as the Web server, you probably want "localhost" instead of "fullhostname".
$db_url = 'mysql://drupalusername:drupalpassword@localhost/drupaldatabasename';
It works now!! Thank you.
If your database is on a different computer, your grant permissions were probably not set to allow the remote Web server to access the database.
GRANT ALL PRIVILEGES ON drupaldatabasename.* TO drupalusername@fullhostname IDENTIFIED BY 'drupalpassword';
I did issue the above command, except the MySQL doc stated to use '%" instead of the actual host name. Did I misunderstand something?
I believe the % represents the wild card for host names. I guess if it works, then it should be okay, but if you want a greater level of security, you should probably use localhost, if you can.
Anyway, its working and I'm very happy!
You're welcome.