Ubuntu 18.04 is the latest LTS version of this huge Linux distribution. So it’s no wonder it’s the one chosen for web application development. In the same way, Ubuntu has many tools for this purpose, however, many of them are not updated to its latest version and makes us miss some new features. One of these tools is PhpMyAdmin which makes it easier for beginners to use and manipulate MySQL or MariaDB data. That is why, in this post, I will show you how to install the latest PhpMyAdmin in Ubuntu 18.04. It is quite easy.
What is PhpMyAdmin?
PhpMyAdmin is a web-based open source tool that helps manipulate MySQL or MariaDB. It is written in PHP and is a free alternative to many paying customers. It supports many of the most common operations performed with these database managers. For example, manipulation and control of data, tables, user as well as export and import data.
On the other hand, PhpMyAdmin has extensive documentation that makes it easy to use. In addition, it has support for many languages so you will not have problems finding yours.
It can be said that PhpMyAdmin is a professional community support tool and is very useful to use.
So, let us start to get the latest PhpMyAdmin on Ubuntu 18.04.
Install the latest PhpMyAdmin on Ubuntu 18.04
1) Install LAMP stack
For better or worse, PhpMyAdmin is a web application. This implies that the necessary software to run a web application must be installed on our computer. That is to say, you have to install LAMP.
However, you can read our post about How to install LAMP on Ubuntu 18.04?
On the other hand, it is good to note that to install PHP and its modules, I recommend these:
:~$ sudo apt install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-curl php7.2-mbstring php7.2-xmlrpc php7.2-mysql php7.2-json
2) Download and install PhpMyAdmin on Ubuntu 18.04
Now it’s time to install PhpMyAdmin. As I mentioned at the beginning, Ubuntu has this tool in its repositories, but it’s a bit old. The best way to install it is through its website.
Open a terminal and run:
:~$ cd /tmp :~$ wget https://files.phpmyadmin.net/phpMyAdmin/4.8.5/phpMyAdmin-4.8.5-all-languages.zip
Then, decompress it. And move it to /usr/share/phpmyadmin.
:~$ sudo apt install unzip :~$ unzip phpMyAdmin-4.8.5-all-languages.zip :~$ sudo mv phpMyAdmin-4.8.5-all-languages /usr/share/phpmyadmin
PhpMyAdmin handles temporary files. It’s a good idea to create a folder to do this. Then, set the correct permission to it.
:~$ sudo mkdir -p /var/lib/phpmyadmin/tmp :~$ sudo chown -R www-data:www-data /var/lib/phpmyadmin
Then, you also need to create a configuration folder for PhpMyAdmin.
:~$ sudo mkdir /etc/phpmyadmin/
After this, create the initial PhpMyAdmin configuration file. Also, inside that file, you have to change the access password and define the temporary folder.
:~$ sudo cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php :~$ sudo nano /usr/share/phpmyadmin/config.inc.php $cfg['blowfish_secret'] = 'your-password'; $cfg['TempDir'] = '/var/lib/phpmyadmin/tmp';
Press CTRL + O to save the changes and CTRL + X to exit.
The next step is to make a virtual host for PhpMyAdmin.
:~$ sudo nano /etc/apache2/conf-enabled/phpmyadmin.conf
So, add the following:
Press CTRL + O to save the changes and CTRL + X to close the file.
:~$ sudo systemctl restart apache2
Now, you can access to PhpMyAdmin using the web browser. http://server/phpmyadmin. Then, Just login with your username and password.
And that’s it.
PhpMyAdmin is a very effective tool to manage MySQL or MariaDB quickly and professionally. This type of tools, it is advisable to have always updated, because with this we will be able to take advantage of it more.
Please share this post with your friends.