– OVERVIEW / THOUGHT PROCESS –
I personally prefer to manipulate MySQL via the command line, but this is not always the best way to do it. The perfect example was the last time I traveled. I was using SSH to talk to my server and the internet went down. Unfortunately, the instance of the open session remains active while I can do nothing. If I use phpMyAdmin, the commands and the session will all be local to the server and therefore will not be interrupted when the internet goes down.
I will continue to use command line to configure MySQL… but this is a great option for those times when internet may not be reliable. That, and the fact that it’s a beautiful interface and extremely powerful.
As always, give it a try. If you don’t like it, get rid of it by just deleting the phpMyAdmin folder that you’ll be creating. No harm, no foul. If you like it, though, it can be a great asset to your administrator’s toolkit!
Here’s whatcha do:
– DOWNLOAD THE FILES –
Download to my home computer:
# FTP or Secure Copy the downloaded files from your computer to the server.
# You can use the wget command from your server terminal:
$ cd ~
$ wget https://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.5.7/phpMyAdmin-3.5.7-all-languages.tar.gz
Connecting to iweb.dl.sourceforge.net|2607:f748:10:12::5f:2|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 6342983 (6.0M) [application/x-gzip]
Saving to: “phpMyAdmin-3.5.7-all-languages.tar.gz”
100%[=========================>] 6,342,983 1.39M/s in 5.0s
2013-03-02 03:56:21 (1.21 MB/s) – “phpMyAdmin-3.5.7-all-languages.tar.gz” saved [6342983/6342983]
– PREPARE THE FILES FOR INSTALL –
# Since I’m already in my home directory, I prefer to unzip it there.
$ tar -xzvf phpMyAdmin-3.5.7-all-languages.tar.gz
# Now we’ll get the actual html directory created and ready. I prefer to simply name it ‘phpMyAdmin’ however you can name it whatever you’d like. Also, sometimes it’s better to simply make a symbolic link and keep all of the files one directory behind the publicly available html directory. For this example, I will keep everything simple:
$ sudo mkdir /var/www/html/phpMyAdmin
# sudo must be used because you may not have permissions to the html directory… I keep my ownership as root to these directories. If something needs access, I keep the group ownership as apache.
$ sudo cp -R phpMyAdmin-3.5.7-all-languages/* /var/www/html/phpMyAdmin/
# This copies all of the files within the newly unzipped directory to the public directory that you just created.
$ cd /var/www/html/phpMyAdmin/
$ ls -al phpMyAdmin/
# And now let’s go there to make sure everything copied over correctly.
# I also like to keep the folder that I unzipped in my home directory… it’s good to have the originals in case you need to backtrack a mistake.
# NOTE: you should configure your server for https (SSL). If you do not, each time you send a request from your browser to the server, the user name and password will be sent un-encrypted which is a very serious security risk. You can refer to this post for instructions to do so. If you’re doing everything to a server that’s sitting right in front of you (localhost), then you won’t need to worry about this.
– WEBPAGE INSTALL OVERVIEW –
# With your favorite browser, visit:
https://<server IP address>/phpMyAdmin/setup
# If you’re on localhost, visit:
MYPHPADMIN INSTALL OVERVIEW:
- Click on ‘New Server’
- Make sure your server hostname is ‘localhost’
- Click ‘Save’
- Visit https://<server IP address>/phpMyAdmin
- Enter Root’s username and address
- Manipulate your databases!
1a. Here’s what you’ll see when you go to the setup website:
1b. Here’s a closeup of the ‘New Server’ button. Click it and see the next step.
2. The minimum setting to get phpMyAdmin up and running is to enter localhost into the Server Hostname space.
3. Once you click ‘Save’ you can visit https://<serverIPaddress>/phpMyAdmin/ or https://localhost/phpMyAdmin to enter your credentials.
4. & 5. I used this picture to show you that the smallest details can delay your install. In this case, I received an error message because phpMyAdmin could not talk to the MySQL server. Why?!? Because I didn’t turn it on. I created this server specifically for this fresh install of phpMyAdmin and forgot to use the command: sudo service mysqld start. As soon as I entered that command into terminal, the myPhpAdmin website was up and running in no time!
6. Once the website was up and running, I entered the root credentials for MySQL into the prompts (error picture above) and this is what I saw:
# When you’re complete with the install, don’t forget to change the permissions for the folder ‘config’ back to only root privileges.
# All in all, it’s a pretty easy install. You can do everything manually if you’d like, but it’s much easier using the setup webpage. To setup phpMyAdmin manually, visit the Official Wiki website for detailed instructions. The bottom line to that manual install is that each entry you make from the setup website corresponds to an entry into the config.inc.php file. The webpage setup simply writes these setting to the file for you. But as always… WHAT IF AND WHY NOT?!? Try it out and see what happens!
Always remember… WHAT IF AND WHY NOT?!?