作者:啊咧咧咧咧咧咧咧列 | 来源:互联网 | 2023-01-30 18:30
我希望能够限制对特定数据库用户帐户的访问,或者阻止特定数据库用户帐户通过phpMyAdmin登录。如何配置phpMyAdmin来做到这一点?
具体来说,我正在运行phpMyAdmin Ubuntu服务器。我想知道如何在phpMyAdmin 本身级别而不是通过Web服务器或OS进行配置。
1> alexw..:
要配置phpMyAdmin,您需要找到您的config.inc.php
配置文件。在Ubuntu上,它位于中/etc/phpmyadmin
。编辑此文件。
在以结尾的块之后,向该文件中添加行$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'
];
您可以all
使用模式替换以匹配特定的IP地址或地址范围。请参阅phpMyAdmin文档中的完整文档。