How to replace login user for phpmyadmin on remote ubuntu 20?

I need to replace login user for phpMyAdmin on remote Ubuntu 20.

I opened file /etc/phpmyadmin/ and modified $dbuser parameter:

# $dbuser='phpmyadmin';



I am able to login with NewUser and Newpassword, but I also can entered into the system with root and Newpassword. My prior login phpmyadmin – does not work(I commented it above).

I restarted Apache with command :

sudo service apache2 restart

How to disable root user for phpMyAdmin?

Actually my dev site was hacked and I lost all my data on MySQL.
Not big deal as it was dev site only, but how to make my site safer ? I think changing login to phpMyAdmin is one step… Any other?

Asked By: mstdmstd


You are on the right track. To disable root login access to phpMyAdmin, you have to set AllowRoot directive to false in your config.

Open /etc/phpmyadmin/, search for $cfg['Servers'][$i]['auth_type'] = 'cookie'; and add $cfg['Servers'][$i]['AllowRoot'] = false; below it. The code should look like this:

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['AllowRoot'] = false;
Answered By: sotirov
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.