Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I installed phpmyadmin in Win7, and if I type http://localhost/phpmyadmin/index.php in the browser, it will log in phpmyadmin as root user by default.

I created a new user but still there's no login window... every time it logs in as root by default.. how can I change user?

Many thanks!

share|improve this question
add comment

4 Answers

this one was tricky to figure out at first, but in the end it's the Egg of Columbus:

  1. Close all open instances to PHPMyAdmin in your browser
  2. Clear cache and passwords (depending on your browser)
  3. Visit your PHPMyAdmin URL (localhost/phpmyadmin for example)

Enter your new username and password. Repeat process if you need to switch users again.

share|improve this answer
add comment

How to set phpmyadmin prompt for login name and password

Set the auth_type to http in you config file of phpmyadmin

$cfg['Servers'][$i]['auth_type']     = 'http';      // Authentication method (config, http or cookie based)
$cfg['Servers'][$i]['user']          = 'root';      // MySQL user 
$cfg['Servers'][$i]['password']      = '';          // MySQL password (only needed 
                                                    // with 'config' auth_type)
share|improve this answer
    
Excellent and to the point answer –  Sami Sep 10 '12 at 13:26
    
I sing up to upvote. –  yygyt Dec 14 '12 at 11:34
add comment

It sounds like you have the default settings, which, in most Windows packages I've seen, usually means that logging as 'root' with password '' is hard-wired into the code and ignores cookies etc. This means it will never offer a log-in window, because it thinks it already has your details, and until you change these settings, DKOATED's answer won't work as the appropriate cookie is never used.

After these settings are changed to use cookies (below), you can use DKOATED's method, or, in some versions of PHPmyadin, there is an icon in the bar of small icons in the top left of the screen that looks like an open door with a green arrow pointing to the left (mouseover text: "Log Out"), which does the same thing slightly more conveniently.

If you got PHPmyadmin through XAMPP, there's a really easy way to change this at the end of this answer. If not, there are a couple of simple changes needed in config files. There's an answer on superuser.com that explains how to change this - I've included a tidied up answer based on that one here, to save time and in case something bizarre happens (e.g. if it was ever deleted or inaccessible for some crazy reason):

  1. Open the config.inc.php file. Since you are not seeing a log-in screen, you probably have $cfg['Servers'][$i]['auth_type'] = 'config' in there, probably around line 19. You will also see your name and password. Something like

    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '';
    
  2. (Recommended) Change the blowfish_secret to any random string. As the file comments say, this string is used to encrypt your password in cookie based authentication (which is what you are about to change to).

    $cfg['blowfish_secret'] = 'a rAnd0m str11!11111!11!nG';
    
  3. Change the authentication type to cookie:

    $cfg['Servers'][$i]['auth_type'] = 'cookie'; // DEFAULT: 'config'
    
  4. (Recommended) Delete or comment out the lines that are storing your password. If, in Priviledges within PHPmyadmin, the root user has no password, you probably should change that and if the config file says $cfg['Servers'][$i]['AllowNoPassword'] = true;, probably best to change true to false after giving root a password.

After doing this, it will start using cookies and will offer a log in window when the cookie doesn't log you straight in, so from here on, DKOATED's answer should work for you when you need to switch users. But DKOATED's answer won't work until PHPmyadmin is set to use cookies. If it doesn't just work, you might need to restart mysql after changing root password.


If you got PHPmyadmin as part of XAMPP (ignore this if you didn't), there's an even easier way. Go to localhost/security, follow the link below the table, and it gives you an option to input the password and change to cookie authentification. Note also that XAMPP is funny about passwords - it needs to be less than 16 characters.

share|improve this answer
add comment

Just open in a new window in Incognito (Chrome) or Private Browsing (Safari, Firefox) mode and visit the URL.

share|improve this answer
add comment

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.