phpMyAdmin is a free application allowing to interact with MySQL from a web browser.


At first, it is important to have a LAMP server already installed on the concerned machine.


The phpMyAdmin installation operates from the following command :

During the installation, you will be asked to choose different configuration parameters.
Apache2 must be chosen as server and you need to answer YES to the question : “Configure the database for phpmyadmin with dbconfig-common

Your password to connect to MySQL will be asked so that phpMyAdmin can join your database.

Your password to connect to phpMyAdmin will be created thereafter.

Once the installation completed, you have to configure Apache with the following parameter and restart the service :

phpMyAdmin is now available with the insecure address http://your-address-ip/phpmyadmin for now.


In order to avoid keeping the access to your database via phpMyAdmin opened to everybody, it is essential to secure the access.
At first, we have to change the Apache configuration and add the element AllowOverride All after the section DirectoryIndex :

Then, we must create a file .htpasswd that will allow to list all the users authorized to access phpMyAdmin :

The password associated to the created user will be asked then encrypted in the file .htpasswd

Finally, we have to create a file .htaccess that will allow to limit accesses to phpMyAdmin.

Please make sure you carefully changed the access path to the file .htpasswd :

It is a type of authentification that will be used to check the passwords. They are checked via HTTP and the Basic key word must not be changed.

Message displayed on the connection pop-up

Access path to the file of .htpasswd

Parameter limiting the access only to users declared in the file of .htpasswd


In order to confirm the whole configuration, we need to restart Apache :

phpMyAdmin is now available with the address http://your-address-ip/phpmyadmin safely.

Categories: DatabaseTutorials

JN Community

Les Ressources, en particulier les tutoriaux, présupposent que l’Utilisateur qui décide de les mettre en œuvre dispose des connaissances, des compétences et de l’expérience nécessaire pour cette mise en œuvre. L’Utilisateur disposant d’une connaissance, compétence et/ou expérience limitée ou insuffisante doit absolument s’abstenir de mettre en œuvre les Ressources par lui-même. Jaguar Network décline toute responsabilité quant aux conséquences dommageables de la mise en œuvre des Ressources, notamment sur les infrastructures informatiques de l’Utilisateur, de ses commettants ou préposés ou de tout tiers. Il est précisé en tant que de besoin que toute intervention de Jaguar Network visant à réparer les dommages causés par la mise en œuvre des Ressources par un Utilisateur ne disposant pas des connaissances, compétences et/ou expériences suffisantes sera facturée et fera l’objet d’un devis préalable et d’un bon de commande aux conditions des contrats Jaguar Network en vigueur.

Related Posts


Shutdown and restart your Linux system

Vote On Linux system, there are a lot of commands to shutdown and reboot your system. This tutorial aims to detail some existing possibilities. Articles similaires


Installation of a web server LEMP (Linux, Nginx, MySQL, PHP)

Vote The installation of a server LEMP Linux + Nginx + MySQL + PHP might be more useful and efficient than an Apache (server LAMP). Articles similaires


Operating load-balancing with HAproxy

Vote HAproxy is a software allowing Load-Balancing between several web servers by allocating requests in an almost transparent way for the user. Articles similaires