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/config.inc.php and modified
# $dbuser='phpmyadmin'; $dbuser='NewUser'; $dbpass='Newpassword'; $basepath=''; $dbname='phpmyadmin'; $dbserver='localhost'; $dbport='3306'; $dbtype='mysql';
I am able to login with
Newpassword, but I also can entered into the system with
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 set
AllowRoot directive to
false in your config.
/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:
/* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['Servers'][$i]['AllowRoot'] = false;