If you want to change the default path of phpMyAdmin to another and then protect the directory for user access via “.htaccess” File.

Edit: “/etc/phpmyadmin/apache.conf”:

Alias /db /usr/share/phpmyadmin

if you take a look into your logwatch and you see something like this :

/phpMyAdmin/scripts/setup.php: 2 Time(s)
       /pma/scripts/setup.php: 2 Time(s)

…. then someone tried to run your phpMyAdmin-Setup.

Edit: “/usr/share/phpmyadmin/.htaccess”:

AuthType Basic
AuthName “Passwortschutz”
require valid-user
AuthUserFile /usr/share/phpmyadmin/.htpasswd

Edit: “/usr/share/phpmyadmin/.htpasswd”:

(you can use a generator like this link.)


this example is for user “test” with the password “1234”.


if you phpmyadmin page is not visible try this:

sudo ln -s /usr/share/phpmyadmin /var/www/

or in our case:

sudo ln -s /usr/share/db /var/www/

but if you have a html folder in www use “/var/www/html”.