MySQL databases are easier to manage via GUI or the web browser.. How does one do that?
While many find it comfortable using the command console to manage MySQL databases, others might not find that appealing, especially for new students.
Interacting with MySQL databases from the command console isn’t for someone who just started learning the basics. That’s why a tool called phpMyAdmin was created.
phpMyAdmin was created so users and new students can interact with MySQL database servers through a web browser. This brief tutorial is going to show you how to install and use phpMyAdmin on Ubuntu systems.
Step 1 : Complete Prerequisites
Before you begin, there are some prerequisites that must be met. You must first install the LAMP stack on Ubuntu, since phpMyAdmin depends on it to function.
This post shows how to install the LAMP stack on Ubuntu:
Lesson 9 : How to Install the LAMP Stack on Ubuntu Systems
Step 2 : Install phpMyAdmin
phpMyAdmin can be installed from the default Ubuntu repositories. All one has to do is run the commands below.
sudo apt-get install -y phpmyadmin
After you run the above command you’ll be prompted with a message below:
Please choose the web server that should be automatically configured to run phpMyAdmin.
Web server to reconfigure automatically:
Choose apach2 — the first option using the space-bar on your keyboard and continue
On the next screen when prompted with the message below, choose Yes
The phpmyadmin package must have a database installed and configured
before it can be used. This can be optionally handled with dbconfig-common. │
If you are an advanced database administrator and know that you want to
perform this configuration manually, or if your database has already │
been installed and configured, you should refuse this option. Details on │
what needs to be done should most likely be provided in /usr/share/doc/phpmyadmin. Otherwise, you should probably choose this option.
Configure database for phpmyadmin with dbconfig-common?
You’ll then be prompted again to create and confirm a password for phpMyAdmin application.
After that, phpMyAdmin will be installed.
Finally, enable php module encrypt by running the commands below.
sudo phpenmod mcrypt
Restart Apache2 and you’re done.
sudo systemctl restart apache2
Open your browser and browse to the machine IP or hostname followed by phpmyadmin
You’l see the logon page for phpMyAdmin as shown below.
User the root password you created for phpMyAdmin to logon. Username is root.