Disabling root login in phpMyAdmin is an important security measure for protecting your database from unauthorized access. The root user in MySQL or MariaDB has full privileges, which means if an attacker gains access to this account, they can potentially cause significant damage to your database.

Advertisement

Here’s a detailed guide on how to 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 the config.in.php in that directory. This is the main configuration file used by the phpMyAdmin.

vim config.inc.php 

Now, add/update the 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.

Conclusion

Disabling root login in phpMyAdmin is a crucial step in securing your database. By following these steps, you can significantly reduce the risk of unauthorized access. Remember, security is an ongoing process, and it’s important to stay vigilant and keep your systems updated.

Share.

1 Comment

Leave A Reply

Exit mobile version