PhpMyAdmin is a user-friendly graphical interface to interact with MySQL/MariaDB and is a cornerstone of any webhosting environment. Because of this, it is also a commonly exploited part of the server and should be connected to with https://. If you have not yet installed an SSL on your domain, its good idea to do so for security with phpMyAdmin.
Before we begin there are a few things you will want to confirm.
- First you will want to have your root MySQL password, typically the same as your root ssh login, and second on your server you will want to make sure you have the following installed:
- These should be installed by default on your server. But if you doubt they are installed you can check by giving the following command in the SSH shell:
php –v && httpd –v && mysql -V
- This will print the version of each to confirm if they are installed.
Installation and Configuration
- Once you have confirmed these are installed on your Ubuntu server you will next install the phpMyAdmin program via the following commands in the SSH shell:
sudo apt-get update
sudo apt-get install phpmyadmin php-gettext php-mbstring
- The commands will ask you several questions to complete the installation:
- For the server selection, use apache2 (select with the space bar, giving a * symbol then hit Tab followed by Enter to confirm)
- Choose Yes when you are asked if you want dbconfig-common to set up the database.
- When prompted, enter and confirm a phpMyAdmin password of your choice, this will be specifically for the user phpMyAdmin (be sure to use a strong password for this including upper & lowercase letters, numbers, and special characters).
- This will create all the necessary files and databases to configure phpMyAdmin.
- To finalize the installation and configuration you will need to enable the PHP extensions mcrypt and mbstring and restart apache with the following commands:
sudo phpenmod cryptsudo phpenmod mbstring
sudo systemctl restart apache2
- .PhpMyAdmin will now be accessible via the internet by using the following URL template:
When you get to the page, give the user “root” and the root MySQL password to gain access to the interface.
While this guide is a great way to get started with phpMyAdmin, the software is something fully supported in our Dedicated and VPS servers, allowing you to get more familiar with other aspects of web hosting.