Mysql password problems

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mrgee
Forum Newbie
Posts: 1
Joined: Mon Dec 04, 2006 4:25 pm

Mysql password problems

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
dibyendrah
Forum Contributor
Posts: 491
Joined: Wed Oct 19, 2005 5:14 am
Location: Nepal
Contact:

Post 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.
Post Reply