Increase session time-out in phpMyAdmin

If you do any development with PHP and MySQL, undoubtedly, you are familiar with phpMyAdmin, which is a web-based tool for managing and editing MySQL databases. While phpMyAdmin is an excellent tool, one of it’s annoying aspects is the default session time-out of 30 minutes. However, you can make a quick configuration change to extend the time-out to most any value that you like.

To do this, just open the file for phpMyAdmin (which is in the /etc/phpmyadmin directory on Ubuntu Linux) in an editor as the administrative user (i.e., use sudo in Linux). Then, add these lines within the 'Servers' configuration section:

/* Set session time out to 8 hours (28800 seconds) */
$cfg['Servers'][$i]['LoginCookieValidity'] = 28800;

Save the changes and restart the Apache web server:

sudo service apache2 restart

The next time that you log into phpMyAdmin, you will stay logged in for 8 hours (or whatever duration you specified). For more information, see phpMyAdmin documentation for LoginCookieValidatity.

Install latest version of Adminer MySQL administration tool on Ubuntu Linux

Adminer is a lightweight, PHP-based MySQL administration tool that is a great alternative to PHPMyAdmin. It comes as a single file and can easily be installed globally on your Ubuntu Linux box, including a Vagrant box.

The prerequisites for installing and using Adminer are PHP, MySQL, and Apache, the so-called LAMP stack. To install them on Ubuntu, in the terminal, run:

sudo apt-get install php5 php5-cli php 5-mysql mysql-server apache2

You’ll be prompted for configuration information during the installation.

Once the LAMP stack is installed, install Adminer by running these commands in the terminal:

sudo mkdir /usr/share/adminer
sudo wget -O /usr/share/adminer/latest.php ""
sudo ln -s /usr/share/adminer/latest.php /usr/share/adminer/adminer.php
echo "Alias /adminer.php /usr/share/adminer/adminer.php" | sudo tee /etc/apache2/conf.d/adminer.conf
sudo service apache2 restart

After installing Adminer, open a web browser and navigate to http://localhost/adminer.php. The Adminer login screen should be displayed. You can now log in to any of the MySQL databases configured.

If you want to upgrade to a new version of Adminer later, since you created a symlink to the latest.php, you can simply run this command in the terminal:

sudo wget -O /usr/share/adminer/latest.php ""