MySQL and PhpMyAdmin

Package Installation

This section will help you get MySQL install, running, and configured. We’ll get PhpMyAdmin installed and configured to help get MySQL fully manageable. First run this command to get the correct packages installed logged in as root.

apt-get install mysql-server php5-mysql

Its going to ask you to enter the root password to MySQL. This can be anything you want it to be, it does not have to correlate with the system root password. Depending on which side of the Security fence you are on, you may want to keep it different.

Now let’s find the latest version of PhpMyAdmin and download it with this command, substituting the link shown here with your link of the latest version. First change directories to make sure you are in /root/. If performing as a non-root user, which is perfectly acceptable, make sure you are in your home directory such as /home/username. This version is PhpMyAdmin 3.3.4, so depending on when you are reading this article version you will need to go to http://www.phpmyadmin.net/ and get the link to the latest version.

cd ~/
wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.3.4/phpMyAdmin-3.3.4-english.zip

After the file has downloaded, unzip, rename the folder to something like “phpmyadmin” or “PHPMYADMIN” or any kind of variation you prefer, and copy it to your web folder, such as /var/www/ or /home/username/Public. Just remember your PhpMyAdmin folder name and how you capitalized it as you will use it often to manage your MySQL databases.

zip phpMyAdmin-3.3.4-english.zip /var/www/phpmyadmin
or
zip phpMyAdmin-3.3.4-english.zip /home/username/phpmyadmin

Now all you need to do is go to your website by going in a web browser to…

https://localhost/phpmyadmin/
or

https://yourwebsite.com/phpmyadmin

Don’t forget the “s” in “https.” You don’t want to advertise your unencrypted login information to potential packet sniffers or snooping users. It is going to prompt you to follow some directions to finish the PhpMyAdmin setup. Their website has the process well documented and is easy to use. Basically, you are going to create a folder and copy a configuration file into it. Then follow the web based installation prompts to finish the setup. Takes about 30 minutes for first timers just because there are a few things you will be unfamiliar with the first time around. For experienced users, it will probably take about 3 minutes.

Now you are able to use MySQL on your server and manage your MySQL databases with PhpMyAdmin.