I need to replace login user for phpMyAdmin on remote Ubuntu 20.
I opened file /etc/phpmyadmin/config.inc.php
and modified $dbuser
parameter:
# $dbuser='phpmyadmin';
$dbuser='NewUser';
$dbpass='Newpassword';
$basepath='';
$dbname='phpmyadmin';
$dbserver='localhost';
$dbport='3306';
$dbtype='mysql';
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?
You are on the right track. To disable
root
login access to phpMyAdmin, you have to setAllowRoot
directive tofalse
in your config.Open
/etc/phpmyadmin/config.inc.php
, search for$cfg['Servers'][$i]['auth_type'] = 'cookie';
and add$cfg['Servers'][$i]['AllowRoot'] = false;
below it. The code should look like this: