Skip to main content

PHPMYADMIN ON UBUNTU 16.04

phpMyAdmin was created so that users can interact with MySQL through a web interface.Before installing phpmyadmin follow our blog regarding LAMP setup on ubuntu:
http://www.goserverspace.com/2017/10/lamp-in-ubuntu-1604.html

Install necessery packages
# apt-get install phpmyadmin php-mbstring php-gettext

The only thing we need to do is explicitly enable the PHP mcrypt and mbstring extensions, which we can do by typing:
# phpenmod mcrypt
# phpenmod mbstring

Now make following changes in config.inc.php
#vi /etc/phpmyadmin/config.inc.php

[...]
$cfg['Servers'][$i]['auth_type']     = 'http';    // Authentication method (config, http or cookie based)?
[...]

# systemctl restart apache2

Configuration file: etc/apache2/conf-available/phpmyadmin.conf(we don't want to use it now)
Here in our LAMP setup we have installed mariadb package.So we want to first create a user with all privileges inorder to use phpmyadmin.So first create it
Mysql -u root -p
>CREATE USER 'newuser'@'%' IDENTIFIED BY 'some_pass';
>GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'%' WITH GRANT OPTION;
>FLUSH PRIVILEGES;

Now restart mysql and apache2 packages
#systemctl restart apache2
#systemctl restart mysql

Now open your browser and access http://your ip/phpmyadmin.Here login by user we created.