How to Install Apache,MySQL and PHP - part 2

step 6

While we can use mysql command line client or mysql workbench visual tool for database administration, I prefer to use phpMyAdmin web application for this task.

 main@work:~# sudo apt install phpmyadmin

Select apache2 as the http server to configure.

Select auto configure the web application via dbconfig-common

Enter the root password you entered above

Comment the lines with ## and add the lines at the end of the file:

 ## Alias /phpmyadmin /usr/share/phpmyadmin

 <Directory /usr/share/phpmyadmin>
     Options FollowSymLinks
     DirectoryIndex index.php

     ##<IfModule mod_php.c>
     ##    <IfModule mod_mime.c>
     ##        AddType application/x-httpd-php .php
     ##    </IfModule>
     ##    <FilesMatch ".+.php$">
     ##        SetHandler application/x-httpd-php
     ##    </FilesMatch>
             php_flag magic_quotes_gpc Off
             php_flag track_vars On
             ...
     ##</IfModule>
 </Directory>

 ...
 <Directory /usr/share/phpmyadmin/setup/lib>
     Require all denied
 </Directory>

 Listen 8080
 <VirtualHost *:8080>
     TransferLog  "/var/log/apache2/phpmyadmin_access.log"
     ErrorLog     "/var/log/apache2/phpmyadmin_errors.log"
     DocumentRoot "/usr/share/phpmyadmin"
 </VirtualHost>

Now we can manage our mysql server at http://work:8080