Access denied for user 'user'@'localhost' (using password: YES)

llyra - February 16, 2006 - 17:12

I am getting this error when I try to view my newly installed Drupal 4.6.5:

Access denied for user 'user'@'localhost' (using password: YES) .. note I changed my user name to 'user' for this post.

I am using PHP 5.0.5 and MySQL 4.1.9. I used PHP MyAdmin to create database and had no problems importing table data.

I updated the settings.php page as instructed. Not sure why I'm getting this error when pointing to http://www.website.com/drupaldirectory/

Did a search and couldn't find answer. Thanks for any assistance!

MySQL permissions

Roberto Gerola - February 16, 2006 - 17:15

Open PHPMyAdmin and go under Privileges section and assign a password to your user.

thank you

llyra - February 16, 2006 - 17:26

Thanks- I figured it out. I had the wrong user listed in mySQL section.

Thanks again!

Help

161962169 - February 16, 2006 - 21:15

I'm having the same problem. I'm using PHP MyAdmin as well, and I cannot seem to find the "privilages" section. Could you give me more detail on what you did? It would be a great help.

Thanks in advance!

My PHP admin

llyra - February 16, 2006 - 21:18

On the Right side there are two sections, one being MySQL and the other being php My Admin

Under the mySQL section (not on the sidebar but the 'main page' content) there is a text link stating privilages. Click on it and it will show you your users.

Hope this helps!

MY PHP Admin help

161962169 - February 17, 2006 - 01:47

I've found where you are talking about, but dont see the link your talking about. There is a list that looks something like this:

MySQL
>Create New Database
>>No Privilages(this is under create new database, and has an X by it)
>Show processes
>Databases
>Export

I'm not sure why it is saying no privilages. Any suggestions?

thanks for all your help!

Plesk/CPanel

Heine - February 17, 2006 - 06:34

On some hosting providers you have one (pre-made) database and that's it.

On some other hosting providers you can create new databases (sometimes up to a maximum) but not via MySQL or phpmyadmin but only via the hosts control panel (CPanel, Plesk).

--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.

Ok...

161962169 - February 17, 2006 - 15:30

I am accessing my server through Plesk. I have created a new database, and a user for it. I followed the instructions for Drupal, entering the username/password of the database user into the default file.

When I open my database to work on it, It opens in a new window using MyPHPAdmin. Your thoughts?

--
Ok, will do.

Plesk

Heine - February 18, 2006 - 18:04

Plesk doesn't provide an interface to privileges as far as I know. It's also disabled in the integrated phpmyadmin. In plesk you add users to a database as you've already done (and all should be well).

When you select the database in Plesk you see the users associated with the database. Selecting the user leads you to a screen where you can modify the password.

Make sure the password doesn't contain special characters (listed in settings.php). Double-check that the username, password and hostname in $db_url are correct. Hostname is usually localhost, but could be different for your provider.

If you really wish to grant privileges you can execute the GRANT command in INSTALL.txt in phpmyadmin; simply select the SQL tab and paste the command in the textfield; edit it to reflect your situation and press go.

Good luck.
--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.

Same issue

craigdurling - February 18, 2006 - 13:52

I'm just new to Drupal and am experiencing the same issue. I am also using Plesk. There is another site running drupal on the same virtual server but at a different domain. In the error page I am seeing when trying to bring my site up, it makes reference to the other domain running drupal. Could this be part of my problem?

Access denied for user@localhost

proudlyphp - July 30, 2008 - 14:48

Thank you in advance.

I am a newbie for cPanel. Recently, we registered for cPanel and I am assigned to administer the web-based database management system. Since we are client to the www.cpanel.net and we get the access through the username and pasword. Once we are connected to this panel, I have access to the MySql database through the username and password using and php code. That is the process.

Below is what I have been doing. I have set privileges in the PhpMyAdmin. I have given you the php connection code. And finally I tried everything with an query string, the last php code I showed you.

Users in swhisadb
swhisa_swhisa (Privileges: ALL PRIVILEGES)

And again I wrote the code inside the connecttodb.php just after connecting, as you recommended. I will show you the improved code and the new error message I got as below:

The following is the connection string.

Code: ( text )

1.

<?php
2. define
('MYSQL_HOST','localhost');
3. define('MYSQL_USER','swhisa_swhisa');
4. define('MYSQL_PASS','nd3R123');
5. define('MYSQL_DB','swhisa_swhisadb');
6. if(!mysql_connect (MYSQL_HOST, MYSQL_USER, MYSQL_PASS)){die (mysql_error()); } mysql_select_db(MYSQL_DB);
7.
8. $grt
= "GRANT ALL ON *.* TO 'swhisa_swhisa'@'%'";
9. mysql_query($grt) or die(mysql_error());
10.
11.
?>

The following is the insert query string
Code: ( text )

1.
2.
3.

<?php
4. ob_start
();
5.
6.
include ('../common/connecttodb.php');
7. echo "Connection Successful!<br>";
8.
9. $sho
= "INSERT INTO `swhisadb`.`tblsug` SET `2ma`=445";
10. mysql_query($sho) or die(mysql_error());
11.
12. header
('Location:../index.php');
13.
14. ob_end_flush
();
15.
?>

After all this, I have the following new error message: Access denied for user 'swhisa_swhisa'@'localhost' (using password: YES).

What is going wrong? Please help.

Hi

santosh_vrose - November 25, 2008 - 14:53

can you send me the script?

regards
santosh

 
 

Drupal is a registered trademark of Dries Buytaert.