-
Notifications
You must be signed in to change notification settings - Fork 2
G. Install phpMyAdmin
Previously we installed MySQL but for many of us out there, we find so little comfort in managing a database system solely through command line, thus we will rely on phpMyAdmin.
In this chapter, the intent is to detail how to install and secure phpMyAdmin so that we can safely use it in managing our database.
The software provides important security features such as:
-
direct communication with the MySQL database
-
handling authentication through MySQL credentials
-
executing and returning results for nominal SQL queries
a. First we will make sure that all packages are up to date:
$ sudo apt update
Secondly we can install phpmyadmin but we can also install a few other extensions that will help in performing certain functionalities and improve performance.
-
php-mbstring- module for managing non-ASCII strings and converting strings to different encodings -
php-zip- extension that support uploading _.zip _files to phpMyAdmin -
php-gd- enables support for the GD Graphics Library -
php-json- provides PHP with support for JSON serialization -
php-curl- alows PHP to interact with different kinds of servers using different protocols
b. I for one will only be installing the following, but if you wish to have all install, just add them at the end (followed ofcourse by a space):
$ sudo apt install phpmyadmin php-mbstring php-gd php-curl
!! You will be prompted some options and in order to configure the installation correct please choose apache2
In order to do so: Hit SPACE, TAB, and then ENTER to select Apache.
When the prompt appears, although it might seem that apache2 is selected, it is only highlighted and SPACE must be pressed.
c. Last step is to restart Apache so that all changes take effect:
sudo systemctl restart apache2
Now our software is installed and configured to work with Apache, and we can login with our dummy MySQL user: username.
Although many think this is self explanatory, i've taken the liberty to emphasise a bit more on the matter:
phpMyAdmin can be accessed though the web interface at: https://your_domain_or_IP/phpmyadmin , but how do we find our domain address?
Well that is oh, so simple when having the right tools.
We can use quite a few commands (hostname, ip addr, ifconfig) and we can even go to Settings to find our ip address but for the purpose of oversimplification see below shortcut.
Open a terminal (CONTROL+T) and type:
$ ifconfig | grep 'inet' | grep -Fv 127.0.0.1 | awk ' FNR==5 {print $2}'
reply: $ 192.168.x.x
Now we form our link-> https://192.168.x.x/phpmyadmin then paste this into browser (default should be Firefox)
Type in your user and password et voila.
Sign in: Username + Password -> Go
Signed in:
**Congrats, you're done!**
We have learned about phpMyAdmin and finished implementing it.
We have also learned how to configure it and access it.
If you hit a problem or have feedback (which is highly welcomed) please feel free to get in touch, more details in the footer.