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.
- SSH to your server as a root user
- 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
- To browse to phpmyadmin you need to have apache setup with a domain name and vhost created.
- 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.
- Assuming you have a vhost created, SSH your server as a root user
- Change directory to your vhost folder where you want phpmyadmin to be EG cd /home/mywebsite.com/
- You may want to make a folder called phpmyadmim
- To make a folder type : mkdir phpmyadmin
- And then change directory into that new folder type cd phpmyadmin
- Type :
wget http://byet.org/phpMyAdmin-3.3.5-all-languages.tar.gz - Now we have downloaded the TAR.GZ file to the phpmyadmin folder, you need to extract the archive.
- To extract the TAR.GZ files type this: tar zxvf phpMyAdmin-3.3.5-all-languages.tar.gz
- Now we need to change directory into the folder that has just been created.
- Type: cd phpMyAdmin-3.3.9.1-all-languages
- Now we need to move the files out of this folder to the folder below.
- Type: mv * ..
- Now you need to change directory to the direcory below where we have just moved the files
- Type: cd ..
- Now we need to rename PHPMyAdmins config file so it works.
- Type: mv config.sample.inc.php config.inc.php
- 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
- Type: pico config.inc.php
- Your screen will change to the pico text editor showing the config file open. Use your arrow keys and find this line:
- $cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
- 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.
- Once this is done the line should look like this:
- $cfg['blowfish_secret'] = 'i-make-a-password-up-here'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
- Now all you need to do is save the file.
- Type : (CTRL KEY) and O (control key and then the O key)
- You will be prompted to save the file as config.inc.php simply press RETURN to save.
- Now quite the pico text editor
- Type : (CTRL KEY) and X (control key and then the X key)
You will return back to your root ssh terminal. - 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.
- Type: chown www-data.www-data ../phpmyadmin -R
- 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
- http://yourdomain.com/phpmyadmin