I'd like to be able to either restrict access to specific database user accounts, or block specific database user accounts from logging in via phpMyAdmin. How can I configure phpMyAdmin to do this?
Specifically, I'm running phpMyAdmin Ubuntu server. I want to know how to configure this at the level of phpMyAdmin itself, and not through the webserver or OS.
To configure phpMyAdmin, you need to find your config.inc.php
configuration file. On Ubuntu, this is located in /etc/phpmyadmin
. Edit this file.
Add lines to this file after the block that ends with $i++
.
$cfg['Servers'][$i]['AllowDeny']['order'] = 'explicit';
$cfg['Servers'][$i]['AllowDeny']['rules'] = [
'allow alex from all'
];
$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow';
$cfg['Servers'][$i]['AllowDeny']['rules'] = [
'deny alex from all'
];
You can replace all
with patterns to match specific IP addresses or ranges of addresses. See the full documentation at the phpMyAdmin docs.