PhpMyAdmin is a LAMP application particularly meant for MySQL server administration. It is an application built on PHP and can be easily accessed through the web browser. In short, it provides a user-friendly graphical interface for database administration.
In this tutorial, I'll explain how to install PhpMyAdmin with LAMP on an Ubuntu 18.04 server.
Before installing PhpMyAdmin, you will need to install MySQL server and configure the password plugin properly for our installation. Assuming you have the root privileges, you can proceed with the pre-installation steps:
To install MySQL, run the following commands from a terminal prompt:
# apt install mysql-server
By default, MySQL uses local system account to log in as user root. This is done with a plugin
“auth_socket". Please see the users password plugin status below:
As explained in the snapshot above, I've updated the root password plugin to
"mysql_native_password" similar to the rest of the system users available and set the MySQL root password as required. This will prevent any MySQL connection problem and errors during the phpmyadmin installation.
Now, you can proceed with your PhpMyAdmin installation.
PhpMyAdmin is available on our default Ubuntu 18.04 repository. Hence, we can install phpmyadmin by just running the command:
# apt-get install phpmyadmin
This installation proceeds with various installation stages as described below:
Stage 1: Installing Apache2
During this installation. it prompts you for the web-server installation, you need to choose the Apache2 option for setting up the web-server automatically with this installation.
Stage 2: Configuring phpmyadmin database with dbconfig-common
In this stage, you will be prompted to configure a database for your PhpMyAdmin installation using dbconfig-common options. You can proceed by selecting "yes" to configure this database automatically.
Stage 3: Setting the MySQL password
In this step, you will need to set a MySQL password for phpmyadmin to connect to the database server.
Once the password is confirmed, it will proceed and completes the installation successfully. In a nutshell, I would say, during this PHPMyAdmin installation, it installs a Web server, configures the database for phpmyadmin and updates the necessary configuration files, configures/install PHP and its required modules. Take a look at the complete list of newly added packages during the installation.
Stage 4: Including the PhpMyAdmin configuration file to Apache 2
This is the final stage, where we need to include our PhpMyAdmin Apache configuration file to our main web server configuration. Please add this include line to the end of Apache 2 configuration file at /etc/apache2/apache2.conf and restart the service to make these changes effective.
Once it's done restart the service using this command below:
# systemctl restart apache2
That's all! we're done with our installation. Now you can access your PhpMyAdmin interface via browser at
http://Server-IP/phpmyadmin/ with your root credentials.
PhpMyAdmin software supports the server which is running either Windows or one of the several Linux distros. This provides you with an excellent solution for administering MySQL and MariaDB databases. You can easily manage any number of databases as needed. In addition, you can manage database tables, values and export/import more efficiently. I hope this tutorial is useful and informative for you! I would really appreciate your valuable comments and suggestions for any further improvements.