Networking, Programming and Graphics - Tutorials
ONLINEHOWTO.net Tutorials Category

How to Configure PhpMyAdmin

Type: Picture Networking, Programming and Graphics - Tutorials
Networking, Programming and Graphics - Tutorials
Level: Beginner Networking, Programming and Graphics - Tutorials 
Networking, Programming and Graphics - Tutorials
Date: 2010-Feb-04
Networking, Programming and Graphics - Tutorials
Visited: 1106 times
Networking, Programming and Graphics - Tutorials
Rating: Networking, Programming and Graphics - Tutorials
Networking, Programming and Graphics - Tutorials
Published: Ivory Morhuld

PhpMyAdmin is very powerful and flexible web based database administration tool. For this feature, that the tools is web based he is platform independent and can work under Windows, Linux, Unix, Apple etc. platfroms.

From server side PhpMyAdmin need:

- An Web Server with PHP support

- PHP with enabled session support, zip extension, mbstring and ctype extensions for UTF-8 support, GD library for image/jpeg: inline JPGs

- MySql database server


For the client PhpMyAdmin need:

- Just an Web Browser

In this tutorial I will show you the main configuration setup for PhpMyAdmin. Current version of used PhpMyAdmin in this tutorial is 3.2.0.1
How to Configure PhpMyAdmin
In the document-root root direcotry exists config.inc.php. This file contains all need settings which is entered like variables and constants.

Lets start with server parameters setup. This parameters is mandatory for correct working of PhpMyAdmin.

First you have to set $cfg['Servers'][$i]['host'] parameter, where is set where Sql server working. If Sql server works on the machine where work the Web server with PHP, you have to set this parameter to be - localhost

Next important parameter is $cfg['Servers'][$i]['auth_type']. This parameters set how the user will login and access to Sql webserver. Possible values are:
- http - this is standard HTTP Basic authentication method which is most secure and is good to be used.
- cookie method need Web browser with enabled cookie support.
- config is less secure methos because login information is hard coded in config.inc.php in $cfg['Servers'][$i]['user'] and $cfg['Servers'][$i]['password'] parameters.
<?php
/*
 * All directives are explained in Documentation.html and on phpMyAdmin
 * wiki <http://wiki.phpmyadmin.net>.
 */
 
/* This is needed for cookie based authentication to encrypt password  */
$cfg['blowfish_secret'] = ''/* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/* Servers configuration */
$i 0;

/* First server */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Servers'][$i]['hide_db'] = '(mysql|information_schema|phpmyadmin)';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';

/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';

/* User for advanced features */
//$cfg['Servers'][$i]['controluser'] = 'root';
//$cfg['Servers'][$i]['controlpass'] = '';

/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';

/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

/* End of servers configuration */

/* Directories for saving/loading files from server */
$cfg['UploadDir'] = 'uploaddir';
$cfg['SaveDir'] = 'savedir';
?>
If you select cookie based authentication you have to enter some value for $cfg['blowfish_secret'] parameter.

Other parameter related with connection to the Sql database server is $cfg['Servers'][$i]['connect_type']. Default value is 'tcp'.

In /* Advanced phpMyAdmin features */ section are parameters for the PhpMyAdmin table names, where are stored some other parameters.

When all of this parameters are set correctly and the user have correctly loged in he have to see screen like this below:
How to Configure PhpMyAdmin
Rate this tutorial:                    
Post Comment

Need a specific tutorial? Do not hesitate and submit a request!
Your e-mail: