Saturday, February 6, 2016

How to install PHPMyAdmin on Lubuntu

Alright on previous article i already show you how to install php and mysql, and i bet you will need graphical interface for managing the database on mysql, that's why we need to install phpmyadmin, so this article i'm going to show you how to install phpmyadmin on lubuntu.

Phpmyadmin is a web based mysql client, it is very popular tool for managing mysql database, you can create new database, create, update, delete and modify tables, etc. Phpmyadmin is really great tool for managing mysql database.

Installing PHPMyAdmin

To install phpmyadmin on lubuntu is very simple, all you have to do is open your terminal/console/command line, and then run this command:

sudo apt-get install phpmyadmin

kernelpanic@kernelpanic:~$ sudo apt-get install phpmyadmin
[sudo] password for kernelpanic: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.2.0-16 linux-headers-4.2.0-16-generic linux-headers-4.2.0-23
  linux-headers-4.2.0-23-generic linux-image-4.2.0-16-generic
  linux-image-4.2.0-23-generic linux-image-extra-4.2.0-16-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  dbconfig-common libjs-sphinxdoc libjs-underscore php-gettext php-tcpdf
Suggested packages:
  javascript-common php5-imagick
The following NEW packages will be installed:
  dbconfig-common libjs-sphinxdoc libjs-underscore php-gettext php-tcpdf
  php5-gd phpmyadmin
0 upgraded, 7 newly installed, 0 to remove and 13 not upgraded.
Need to get 12,3 MB of archives.
After this operation, 45,6 MB of additional disk space will be used.
Do you want to continue? [Y/n]

During installation there will be a few pop up dialog appears asking you some questions, the first one is 'web server to reconfigure automatically?' the answer is 'apache2'.

Next you will be asked another questions which is 'configure database for phpmyadmin with dbconfig-common?' and the correct answer is 'yes'.

Next you will be asked to enter mysql database server password for user administrator, make sure you enter the correct one.

At this point, phpmyadmin is installed on your lubuntu, but you can't use it yet, because it's not configured the path of phpmyadmin on the apache web server.

Configuring Apache web server

To make apache understand the location of phpmyadmin, we need to edit the apache config file and add some code at the end of the config file.

To open the apache config file, simply run this command:

sudo leafpad /etc/apache2/apache2.conf

Add this code at the end of the config file:

Include /etc/phpmyadmin/apache.conf

Next we need to restart the apache web service, so that the changes we did on the config can take effect, to restart apache web server simply run this command:

sudo service apache2 restart

Finally, we can test the phpmyadmin itself, open your favorite web browser and go to http://localhost/phpmyadmin/, it should be like this:

You can login with your mysql username (root) and the password, now you can start creating new databases, create tables, update tables, modify tables, insert data, etc with phpmyadmin.

~ enjoy ~

No comments:

Post a Comment