Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using rhel 5 and php 5 with mysql 5. My server is already configured and running all applications smoothly. I am accessing mysql as root and supplying my password. However, when I access phpmyadmin through browser, it is not asking for my password. Somebody please tell me how can I set it to prompt for username and password. Since I am not familiar with php and mysql please tell me how to do it in simple way.

share|improve this question

This is easy to be done.
Go to /my/path/to/phpmyadmin/ Open it up with your favorite editor and:

// Uncomment this line if it's commented. 
// Then insert a random string in the quotes ('').
// Have in mind not to enter symbols as " or ' in the quotes.
// You could use something like this - dsd87892@829109skmclwopa&
// It doesn't matter what exactly you type as long as it's not ' and " :)
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

// Then find this and set it to cookie. ( I don't know what's the default. )
$cfg['Servers'][$i]['auth_type'] = 'cookie'; 

Everything now should be working fine and should ask for a user and password.
Additionally you could add an HTTP Auth as @Cocowalla said - for even more security.

Hope this helps :)

share|improve this answer
Work great! Thanks for the answer – tepkenvannkorn Jul 3 '14 at 1:28

You can use Apache HTTP authentication for phpMyAdmin, or you can specify a username and password in the file in your phpMyAdmin installation directory.

More information available here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.