Skip to content

Instantly share code, notes, and snippets.

@ps
Last active August 29, 2015 13:57
Show Gist options
  • Save ps/9799328 to your computer and use it in GitHub Desktop.
Save ps/9799328 to your computer and use it in GitHub Desktop.
Installing MySQL and phpMyAdmin
First we need to install MySQL with the following:
sudo apt-get install mysql-server
Note: You will be prompted for the root password in the middle of the installation.
Now this is optional (for uses with MySQL workbench):
sudo apt-get install mysql-client
Now to test it out try: mysql -uroot -p
You will be prompted for your password and bam! You have mysql installed
To make sure you have access to MySQL from PHP do:
sudo apt-get install php5-mysql
sudo service apache2 restart
Now onto installing phpMyAdmin
sudo apt-get install phpmyadmin
During the installation:
Select 'Apache2' for the server
Choose 'Yes' when asked about database configuration
Enter MySQL root password
Enter password you'd like to use for phpmyadmin access (username will be root)
Now edit apache config file:
sudo vim /etc/apache2/apache2.conf
Add the following line at the bottom of the file above:
Include /etc/phpmyadmin/apache.conf
Now:
sudo service restart apache2
And bam! Navigate to localhost/phpmyadmin and you will be presented
with a login screen where you can login as root with the password specified
in the installation.
References
-----------
Thanks Digital Ocean: https://www.digitalocean.com/community/articles/how-to-install-and-secure-phpmyadmin-on-ubuntu-12-04
MySQL setup: StackOverflow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment