phpMyAdmin is the most popular web application for managing MySQL database servers. Many users also used it to access databases of production environments. In that case, security is a major concern. Providing root account access of phpMyAdmin can be harmful to your database server. So we recommend using non-root accounts for acceding databases.
This tutorial will help you to completely disable root login in phpMyAdmin.
Disable root Login in phpMyAdmin
First of all, find the phpMyAdmin directory location as per your installation. Generally, it is installed under /usr/share/phpmyadmin
directory. In some cases, the configuration file may be located under the /etc/phpmyadmin
directory.
Switch to the phpMyAdmin directory:
cd /usr/share/phpmyadmin
Then edit config.in.php
, which is the main configuration file for phpMyAdmin.
vim config.inc.php
and add/update following parameters:
$cfg['Servers'][$i]['auth_type'] = 'cookie '; $cfg['Servers'][$i]['AllowRoot'] =FALSE ;
Some of the default installations may not have the config.inc.php. In that case, you can make a copy of the config.sample.inc.php file at the same location.
cp config.sample.inc.php config.inc.php
Test Configuration
Open phpMyAdmin in a web browser and try login with the root account. You will see “Access denied!” error message on screen. It means the changes work correctly.
References:
How to Install phpMyAdmin on CentOS using Yum
Setup phpMyAdmin on CentOS, RHEL and Fedora Using Source Files
1 Comment
Thanks! But how without ‘root’ then do I access the phpmyadmin? 🙂