Page 1 of 1

Mysql password problems

Posted: Mon Dec 04, 2006 4:32 pm
by mrgee
From the linux shell I can use the following command #mysql --u root -p ...it then prompts for thr root password..I enter the password and I am successfully into mysql..
However when I try to use phpMyAdmin with the same root password I receive this error....
1045 - Access denied for user 'root'@'localhost' (using password: NO).. SAme also now I cannot access my mambo driven website,,,
ANy help...?
suse linux 10.1
mysql 5.0.18
php 5.1.2

Posted: Mon Dec 04, 2006 5:00 pm
by feyd
That would suggest that the scripts don't know your password.

It's really really not recommended to ever use the root user, especially from scripts.

Posted: Tue Dec 05, 2006 12:16 am
by dibyendrah

Code: Select all

Access denied for user 'root'@'localhost' (using password: NO
It means, you don't have password stored in config.inc of phpmyadmin.

Code: Select all

$cfg['Servers'][$i]['password']      = 'YOUR_PASSWORD_HERE';
It's not a good idea to store root user's password in plain text in config.inc as well. To make it secure, just use the following :

Code: Select all

$cfg['Servers'][$i]['auth_type']     = 'http';
When you finish editing, just browse the phpmyadmin and it will ask both username and password.

The complete configuration will be :

Code: Select all

$cfg['Servers'][$i]['auth_type']     = 'http';    // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user']          = '';      // MySQL user
$cfg['Servers'][$i]['password']      = '';          // MySQL password (only needed
Hope that will help you.