Auto-Login phpMyAdmin at Localhost

  • Update On February 22nd, 2020
  • in PHPMyAdmin
Auto Login PHPMyAdmin 800x300 - Auto-Login phpMyAdmin at Localhost

This post was last updated on February 22nd, 2020 at 08:29 am

Developing a PHP project is easier and faster when we do it on a local web server, installed on our personal computer. A basic local server for PHP projects consists of  PHP and MySQL and to interact with MySQL databases we use phpMyAdmin, it is the most common method of administering a MySQL database.

But while using the application (phpMyAdmin), we have to log in and when the cookie expires, we have to log in again. It’s little annoying (in my opinion) to log in every time when we need to work fast. So in this post, I will share some useful modifications to the default configuration options to enabling auto-login when we visit phpMyAdmin.

To start with we need to find the configuration file with the name config.inc.php in the phpMyAdmin installation directory. Open the config.inc.php file with your text editor and make the following changes.

$cfg['LoginCookieValidity'] = 10000;// Add this line to extend cookie validity

$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
//And replace the line of code by blow code

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root'; // Your user name 
$cfg['Servers'][$i]['password'] = ''; // Your password

After Saving the file shut down your DB server & restart again. Now when you visit you will see that login form won’t be seen and you will be automatically redirected to the Home page.

Finally, There are lots of other configuration options for phpMyAdmin, which are documented on phpMyAdmin wiki. If you find any other annoying defaults that you changed on a fresh install? Let me know in the comments.

About This Author

My name is Parameshwar Roy (P. Roy), and I am a web developer. This is my personal blog to record my own thoughts. Though I am not a natural writer, I love to share my experiences. Hope my experiences will be useful to you...read more about me

Comments are closed