Thursday 8 November 2018

Mysql: Auto-login phpMyAdmin

We want to auto login users in phpMyAdmin. Now we have a web-interface, written in PHP. Users can login. After logging in, they can click on the SQL link in the menu that opens phpMyAdmin. Is there a way to log them in automatically? Is it possible to set cookies for phpMyAdmin or something to let them use it? We don't want to turn off phpMyAdmin's login; each user has his own MySQL user/pass combination. So we need to pass the username/password settings to phpMyAdmin.

 Answers


You can simply post the username in a field named pma_username and the password in pma_password. Or, if you're using http auth mode you can create a link with username and password like http://user:pass@www.host.com/phpmyadmin/...



Edit config.inc.php
Location : /etc/phpmyadmin/config.inc.php
Find for the blow code
$cfg['Servers'][$i]['auth_type'] = 'cookie';
And replace the line of code by blow code
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['username'] = 'root';
$cfg['Servers'][$i]['password'] = 'your_password';
If your password null or '' the uncomment the blow line
//$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
to
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
then it will work fine !

0 comments:

Post a Comment