Mobile app version of vmapp.org
Login or Join
Connie744

: How to login as another user in phpmyadmin 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.

@Connie744

Posted in: #Authentication #Localhost #Phpmyadmin #Windows7

I installed phpmyadmin in Win7, and if I type 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!

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Connie744

4 Comments

Sorted by latest first Latest Oldest Best

 

@Harper822

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

10% popularity Vote Up Vote Down


 

@Angela700

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)

10% popularity Vote Up Vote Down


 

@Cody1181609

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, uberconversion's answer won't work as the appropriate cookie is never used.

After these settings are changed to use cookies (below), you can use uberconversion's method, or, in some versions of PHPMyAmdin, 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):


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'] = '';

(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';

Change the authentication type to cookie:

$cfg['Servers'][$i]['auth_type'] = 'cookie'; // DEFAULT: 'config'

(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, uberconversion's answer should work for you when you need to switch users. But uberconversion'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.

10% popularity Vote Up Vote Down


 

@Angela700

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


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


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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme