PhpMyAdmin

From Grid5000

Jump to: navigation, search


Contents

Overview

PhpMyAdmin is an open source tool written in PHP intended to handle the administration of MySQL over the Internet. Currently it can create and drop databases, create/drop/alter tables, delete/edit/add fields, execute any SQL statement, and manage keys on fields.

Image:Note.png Note

This page shows how to install phpmyadmin on a debian distribution.

Image:Note.png Note

You can also access to phpmyadmin by the following URL : https://www.grid5000.fr/phpmyadmin/

Installation

From sources

  • Retrieve the archive
   /var/www/$wget http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-2.11.2-all-languages.tar.gz?download
  • Extract the archive
   /var/www/$tar -xzf phpMyAdmin-2.11.2-all-languages.tar.gz && mv phpMyAdmin-2.11.2-all-languages phpMyAdmin

From package

   apt-get install phpmyadmin
Image:Note.png Note

For CentOS, use the EPEL repo, and yum install -y phpmyadmin

Configuration

Here is a sample of conf.inc.php in the phpMyAdmin directory. In the installation from source, you can use the script setup.php to create this file.

...
/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
 $cfg['blowfish_secret'] = 'pigeon oiseau à la grise robe'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
 
/*
 * Servers configuration
 */
 $i = 0;
 
/*
 * First server
 */
 $i++;
 /* Authentication type */
 $cfg['Servers'][$i]['auth_type'] = 'cookie';
 /* Server parameters */
 
 $cfg['Servers'][$i]['host'] = 'mysql';
 $cfg['Servers'][$i]['connect_type'] = 'tcp';
 $cfg['Servers'][$i]['compress'] = false;
 
 /* Select mysqli if your server has it */
 $cfg['Servers'][$i]['extension'] = 'mysql';
 ...

Test

Launch a local navigator with the url of phpMyAdmin :

   elinks http://localhost/phpmyadmin

Use

  • ssh tunneling

From your computer use ssh tunneling with port forwarding to acces phpMyAdmin.

   ceintrey@bargkass:~$ ssh -L 10000:localhost:80 bourdon

And acces it from your favorite navigator

   http://localhost:10000/phpmyadmin
  • acces from helpdesk

You also can use rewriting rules to acces through helpdesk : https://helpdesk.grid5000.fr/admin/site/phpmyadmin
Add the following lines in apache site configuration :

# Activation Rewrite rules
   RewriteEngine On
#phpmyadmin
   RewriteRule ^/admin/[Ss]ite/phpmyadmin/(.*)$ /var/www/phpmyadmin/$1 [L] 

And reload configuration : invoke-rc.d apache2 reload

Personal tools
Wiki special pages