Home arrow PHP arrow Page 4 - Doing More With phpMyAdmin (Part 1)

The More the Merrier - PHP

You might not know this, but you can do a lot more with phpMyAdmin than just create tables and insert records. This first in a two-part series takes a look at some of the other features hidden under the hood of this popular PHP application, explaining how it can be used to secure access to the MySQL server, manage multiple servers, manipulate user privileges, view reports on server activity, and export MySQL data into different formats.

TABLE OF CONTENTS:
  1. Doing More With phpMyAdmin (Part 1)
  2. Start Me Up
  3. Locking the Doors
  4. The More the Merrier
  5. A Perfect State
  6. The Privileged Few
  7. In and Out
  8. Mood Ring
By: Harish Kamath, (c) Melonfire
Rating: starstarstarstarstar / 148
October 27, 2003

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
You can also use phpMyAdmin to manage multiple database servers using the same instance of phpMyAdmin. Go back to the phpMyAdmin configuration file, and take a closer look at the server configuration block you manipulated earlier.

If you keep reading, you'll notice that the first configuration block is followed by many similar blocks, each one configured by default with empty values.

$i++;
$cfg['Servers'][$i]['host'] = '';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = FALSE;
$cfg['Servers'][$i]['controluser'] = '';
$cfg['Servers'][$i]['controlpass'] = '';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['only_db'] = '';
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['pmadb'] = ''; // 'phpmyadmin' - seescripts/create_tables.sql
$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]['verbose_check'] = TRUE;
$cfg['Servers'][$i]['AllowDeny']['order']
    = ''; $cfg['Servers'][$i]['AllowDeny']['rules']
    = array();

In order to manage more than one server with phpMyAdmin, therefore, all you need to do is configure more servers, by setting values for each block. In case you run out (the default configuration file for phpMyAdmin supports 2 servers other than the primary one), just replicate an empty block (like the one) above and set values for it in the normal manner.

Once multiple servers have been configured, phpMyAdmin will first display a list of servers, and allow you to select a server from the list for use, as seen here.

Note that phpMyAdmin does not automatically connect to all the configured servers on startup; it only attempts a connection when a user selects a server.

In case you need to disable access to a server temporarily, simply set the "host" parameter of the corresponding configuration block to empty, and the server will be ignored by phpMyAdmin

You can also have phpMyAdmin automatically attempt a connection to any one of the listed servers via the $cfg['ServerDefault'] variable in the configuration file. For example,

$cfg['ServerDefault'] = 2;

 
 
>>> More PHP Articles          >>> More By Harish Kamath, (c) Melonfire
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap

Dev Shed Tutorial Topics: