Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

#1045 - Access denied for user 'root'@'localhost' (using password: YES)

Posted on 2009-02-22
6
Medium Priority
?
8,547 Views
Last Modified: 2013-12-12
Hello,

I am using a standard [config.inc.php] for phpMyAdmin.  When trying to login to my VPS I received that error:

#1045 - Access denied for user 'root'@'localhost' (using password: YES)

This is a fresh install of phpMyAdmin on Debian 4, I am wondering what is wrong?

I have two default MySQL users defined with ALL privileges:

- root@localhost
- root@vpsxxx

I attached the content of my [config.inc.php] for readability.

Thanks, D.
<?php
 
$cfg['blowfish_secret'] = 'simple_key'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
 
$i = 0;
$i++;
 
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
 
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
 
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
 
/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
 
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
 
?>

Open in new window

0
Comment
Question by:deve-lopez
6 Comments
 
LVL 26

Accepted Solution

by:
Umesh earned 225 total points
ID: 23708436
Can you connect using command line to the MySQL server?

mysql -u root -p

Also try adding these lines to config file

$cfg['Servers'][$i]['user'] = 'root';

$cfg['Servers'][$i]['password'] = 'Password_Here';
0
 

Author Comment

by:deve-lopez
ID: 23708465
Hi! Attached is the result I get after trying the command [mysql -u root -p] and typing in the password.
Does that mean the pwd of root user for MySQL is different than the pwd for the VPS?


vpsxxx:~# mysql -u root -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
vps217:~# 

Open in new window

0
 
LVL 26

Assisted Solution

by:Umesh
Umesh earned 225 total points
ID: 23708482
>>Hi! Attached is the result I get after trying the command [mysql -u root -p] and typing in the password.
Does that mean the pwd of root user for MySQL is different than the pwd for the VPS?

Pls don't get confused.. MySQL root is totally different from VPS( server on which MySQL is running)... error simply states that Password entered is not matching with the password stored for the user root in grant tables...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 8

Assisted Solution

by:agamal
agamal earned 75 total points
ID: 23708793
i think you need to reset the root password of this mysql


maybe a mistyped or case sensitive error


http://www.debianadmin.com/recover-mysql-database-root-password.html
0
 
LVL 27

Assisted Solution

by:Lukasz Chmielewski
Lukasz Chmielewski earned 75 total points
ID: 23708805
the default root password may be empty, so try to connect without using password for a root
0
 

Author Comment

by:deve-lopez
ID: 23708831
Cool!
I reset the pwd for mysql user and it works now.
I run into another kind of error afterward so I uninstalled phpmyadmin and did that:

apt-get update
apt-get install phpmyadmin

Now I can connect and I no longer have the 2nd error message about blowfish_secret not being set.

Hope this will help someone else.

Thanks for all the reply, D.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question