, , , ,

step.1 Install the MySQL Server

# Update all local repositories to prevent dependencies.
$ sudo apt-get update 
$ sudo apt-get install mysql-server mysql-client libmysqlclient-dev

# Edit the mysql configuration
$ sudo vi /etc/mysql/my.cnf 

Take Note: You will be prompted to enter the username/password for your phpmyadmin. Take note on that and dont forget it!!

# In case you want to change root password again:
$ mysqladmin -u root password newpassword
$ mysqladmin -h root@local-machine-name -u root -p password newpassword

step.2 Mysql for Apache HTTP Server

$ sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
# Next you will be prompted to choose the webserver a)apache2 b)lighttpd, select apache2 hit OK!

$ sudo vi /etc/php5/apache2/php.ini
# Add the following line to the bottom of php.ini file: extension=mysql.so

Please note inorder to get phpmyadmin working you had to open /etc/apache2/apache2.conf and add the line at the bottom: Include /etc/phpmyadmin/apache.conf
$ sudo vi /etc/apache2/apache2.conf

IncludeOptional sites-enabled/*.conf

Include /etc/phpmyadmin/apache.conf
then restart apache. Examples:

$ sudo /etc/init.d/apache2 restart
$ sudo /etc/init.d/apache2 status
$ sudo /etc/init.d/apache2 stop
# or sudo service apache restart|stop|status

After you restarted your Apache, try to access the phpmyadmin in your browser http://localhost/phpmyadmin.
In case, you can’t access (404 Not Found) the phpmyadmin web interface then try to symlink it.

$ sudo ln -s /usr/share/phpmyadmin /var/www/html ## Note: since Ubuntu 14.04 you may want to use /var/www/html/ instead of /var/www/

Well done!