Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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

More information available here.

share|improve this answer

This is easy to be done.
Go to /my/path/to/phpmyadmin/config.inc.php. 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 at 1:28

Your Answer

 
discard

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.