phpMyAdmin, MySQL and security

hypocampers

Registered
I have been working with MySQL, all intalls ok and I can do most of the things you would want with the database.

The main login screen suggested that I set a password for the root account, I eventually did this and as you might guess I am unable to access MySQL and get this reply:

Access denied for user: 'root@localhost' (Using password: NO)

This is fine, but I can't find in my book how I supply username and password parameters to get into the database. I may have this all wrong, but I can quite happily access all the necessary through the mysql prompt, but its usefull to be able to see via a GUI as well.

If you've been here, what did you do?

Cheers
 
I'm slightly confused about what exactly you were trying to use to get into MySQL, so here is the info on both MySQL prompt and PHPMyAdmin. Just ignore what you don't need.

MySQL Prompt:
To specify a user add "-u username"
To specify a password add "-p" then it will ask you for the password.

PHPMyAdmin:
Open config.inc.php in a text editor (I use BBEdit) and look for the section called "Server(s) configuration"
There should be a section that says $cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname (if not, add "localhost" between the single quotes)

Under that section there is one that says "auth_type" it is up to you, but you can use config (the configuration file), HTTP (you have to enter the password at a prompt), or cookie (I've never used it, but I assume you log in and it gives you a cookie)
The next line should say "user" set that too "root" or whatever user you would like
The line after user is password if you use the "config" auth_type you should put the password there.

Hopefully that will get you into your database.
 
try:
shell> mysql -u username -p
shell> password: *****

That should get you in if all is well with the user db and you're using the correct login.

For more info, check out this stuff
 
Sorry for the confusion, I blame it on the "red wine". You've both answered my questions, thanks again.

My problem was accessing MySQL using phpMyAdmin after I had set a password for root under MySQL using mysqladmin.

Cheers
 
Back
Top