Denying access to phpMyAdmin from all but certain IP adressen
Facts - Php
Sunday, 20 January 2008 17:36

For developing websites I use a MySQL database. This database can be controlled via a browser using phpMyAdmin. I have everything installed locally on my laptop. When I am connected to the internet or to a company network I do not want other people to connect to the MySQL databases on my laptop via phpMyAdmin. So I use the following in the file config,inc.php of phpMyAdmin to restrict access to from remote machines:

 
$cfg['Servers'][$i]['AllowDeny']['order']  = 'deny,allow';
$cfg['Servers'][$i]['AllowDeny']['rules'][] = 'allow % from 127.0.0.1';
$cfg['Servers'][$i]['AllowDeny']['rules'][] = 'deny % from all';
 

This means that only users logged into my laptop are allowed to see the phpMyAdmin pages in their browser. The percent sign (%) stands for "all users".