Installing phpMyAdmin (debian)

Database management can actually be made easier with phpMyAdmin

PHPMyadmin is a PHP script that you can install into your VPS and use it to manage your database.   Below is our instructions on how to do it.

1)  Set a root password for MySQL

Our new VPS servers come with a blank / empty MySQL root password which is no good for PHPMyadmin, you need to set a root MySQL password to allow PHPMyadmin to let you login.

  1. SSH to your server as a root user
  2. type :      mysqladmin -u root password NEWPASSWORD

 

(replace NEWPASSWORD with your preferred root mysql password)

2) Ensure you have a domain or Vhost configured on your server

  1. To browse to phpmyadmin you need to have apache setup with a domain name and vhost created.
  2. If you have not created a VHOST and added a domain to your VPS please follow this guide here

 

3) Upload PHPmyadmin to your VHOST's document root.

  1. Assuming you have a vhost created, SSH your server as a root user
  2. Change directory to your vhost folder where you want phpmyadmin to be EG cd /home/mywebsite.com/
  3. You may want to make a folder called phpmyadmim
  4. To make a folder type :     mkdir phpmyadmin
  5. And then change directory into that new folder type   cd phpmyadmin
  6. Type :     wget http://byet.org/phpMyAdmin-3.3.5-all-languages.tar.gz
  7. Now we have downloaded the TAR.GZ file to the phpmyadmin folder, you need to extract the archive.
  8. To extract the TAR.GZ files type this:   tar zxvf phpMyAdmin-3.3.5-all-languages.tar.gz
  9. Now we need to change directory into the folder that has just been created.
  10. Type:  cd phpMyAdmin-3.3.9.1-all-languages
  11. Now we need to move the files out of this folder to the folder below.
  12. Type: mv * ..
  13. Now you need to change directory to the direcory below where we have just moved the files
  14. Type:  cd ..
  15. Now we need to rename PHPMyAdmins config file so it works.
  16. Type: mv config.sample.inc.php  config.inc.php
  17. Now we need to edit that file and make up any password and enter it in the blank space for the blowfish_secret, to do this we will use a text editor called pico
  18. Type:  pico config.inc.php
  19. Your screen will change to the pico text editor showing the config file open.  Use your arrow keys and find this line:
  20. $cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
  21. Now use your arrow keys to move to the two empty single speechmarks '' and type into those '' a new random password, you can make anything up.
  22. Once this is done the line should look like this:
  23. $cfg['blowfish_secret'] = 'i-make-a-password-up-here'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
  24. Now all you need to do is save the file.
  25. Type : (CTRL KEY) and O (control key and then the O key)
  26. You will be prompted to save the file as config.inc.php simply press RETURN to save.
  27. Now quite the pico text editor
  28. Type : (CTRL KEY) and X (control key and then the X key)
    You will return back to your root ssh terminal.
  29. Now we finally need to change the ownership of your files to make sure your webserver can read them, usually our VPS server uses www-data as the user for the webserver.
  30. Type:    chown www-data.www-data ../phpmyadmin -R
  31. You should now be able to browse to your installation and login using the user: root and your password you setup at the start.  EG
  32. http://yourdomain.com/phpmyadmin