Mini Servers: phpMyAdmin - Enable support for minis

From The Uniform Server Wiki
Jump to navigation Jump to search

Mini Servers:  Introduction | Support | Server 1 - Portable | Server 2 - Service | Server 3 - Portable Authentication | Server 4 - Portable Authen. SSL | Server 5 - SSL Standalone | Browsers dislike self-signed certificates | Server 6 - PHP 5.2.6 Portable | Server 7 - PHP 5.2.6 Service | Server 8 - MySQL Support | Guest Book | Server 9 - Perl 5.2.6 Portable | Server 10 - Perl 5.2.6 Service | Server 11 - MySQL 5.0.67 Portable | Server 12 - MySQL 5.0.67 Service | Server 13 - MySQL 4.1.22 Portable | Server 14 - MySQL 4.1.22 Service | phpMyAdmin - Mini support | MySQL - General problems

Mini Servers:
Compact but fully functional.

phpMyAdmin – Administering multiple MySQL servers.

Running more than one MySQL server! Why not take advantage of Uniform Server 3.5-Apollo’s built in phpMyAdmin to administer all your servers.

Our two mini servers (11 and 13) are ideal for exploring this area the following step-step-guide shows how to set up phpMyAdmin to select and administer each server.

Top

Preparation

Start with a new copy of Uniform Server and set the MySQL password I will be using the default root in this tutorial. After setting a password stop the server.

Run mini server 11 and set password to server11 similarly run mini server 13 and set password to server13. Leave the mini MySQL servers running these will be accessed latter.

Note: You can use any passwords you like just substitute in the appropriate place.

Top

Three MySQL servers

There are three MySQL servers to be supported by phpMyAdmin the following information is required to set-up it’s configuration file:

Server name: Uniform Server Mini 11 Mini 13
User name: root root root
Password: root server11 server13
Port: 3306 3311 3313

Top

phpMyAdmin set-up

Open file config.inc.php located in folder *\Uniform Server\udrive\home\admin\www\phpMyAdmin

Locate the following section cut and paste it three times. These three continuous blocks match the three MySQL servers the first block is already set-up for Uniform Server's MySQL server the next two blocks require changing see following sections.

// The $cfg['Servers'] array starts with $cfg['Servers'][1].  Do not use $cfg['Servers'][0].
// You can disable a server config entry by setting host to ''.
$i++;
$cfg['Servers'][$i]['host']          = 'localhost'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port']          = '';          // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket']        = '';          // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type']  = 'tcp';       // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['extension']     = 'mysqli';     // The php MySQL extension to use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress']      = FALSE;       // Use compressed protocol for the MySQL connection
                                                    // (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['controluser']   = '';          // MySQL control user settings
                                                    // (this user must have read-only
$cfg['Servers'][$i]['controlpass']   = '';          // access to the "mysql/user"
                                                    // and "mysql/db" tables).
                                                    // The controluser is also
                                                    // used for all relational
                                                    // features (pmadb)
$cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user']          = 'root';      // MySQL user
$cfg['Servers'][$i]['password']      = implode ('', file ('../mysql_password'));                   // MySQL password (only needed
                                                    // with 'config' auth_type)
$cfg['Servers'][$i]['only_db']       = '';          // If set to a db-name, only
                                                    // this db is displayed in left frame
                                                    // It may also be an array of db-names, where sorting order is relevant.
$cfg['Servers'][$i]['verbose']       = 'Uniform Server';          // Verbose name for this host - leave blank to show the hostname

$cfg['Servers'][$i]['pmadb']         = 'phpmyadmin';          // Database used for Relation, Bookmark and PDF Features
                                                    // (see scripts/create_tables.sql)
                                                    //   - leave blank for no support
                                                    //     DEFAULT: 'phpmyadmin'
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';          // Bookmark table
                                                    //   - leave blank for no bookmark support
                                                    //     DEFAULT: 'pma_bookmark'
$cfg['Servers'][$i]['relation']      = 'pma_relation';          // table to describe the relation between links (see doc)
                                                    //   - leave blank for no relation-links support
                                                    //     DEFAULT: 'pma_relation'
$cfg['Servers'][$i]['table_info']    = 'pma_table_info';          // table to describe the display fields
                                                    //   - leave blank for no display fields support
                                                    //     DEFAULT: 'pma_table_info'
$cfg['Servers'][$i]['table_coords']  = 'pma_table_coords';          // table to describe the tables position for the PDF schema
                                                    //   - leave blank for no PDF schema support
                                                    //     DEFAULT: 'pma_table_coords'
$cfg['Servers'][$i]['pdf_pages']     = 'pma_pdf_pages';          // table to describe pages of relationpdf
                                                    //   - leave blank if you don't want to use this
                                                    //     DEFAULT: 'pma_pdf_pages'
$cfg['Servers'][$i]['column_info']   = 'pma_column_info';          // table to store column information
                                                    //   - leave blank for no column comments/mime types
                                                    //     DEFAULT: 'pma_column_info'
$cfg['Servers'][$i]['history']       = 'pma_history';          // table to store SQL history
                                                    //   - leave blank for no SQL query history
                                                    //     DEFAULT: 'pma_history'
$cfg['Servers'][$i]['verbose_check'] = TRUE;        // set to FALSE if you know that your pma_* tables
                                                    // are up to date. This prevents compatibility
                                                    // checks and thereby increases performance.
$cfg['Servers'][$i]['AllowRoot']     = TRUE;        // whether to allow root login
$cfg['Servers'][$i]['AllowDeny']['order']           // Host authentication order, leave blank to not use
                                     = '';
$cfg['Servers'][$i]['AllowDeny']['rules']           // Host authentication rules, leave blank for defaults
                                     = array();

Top

phpMyAdmin block2

In the second block locates these lines:

$cfg['Servers'][$i]['port']          = '';          // MySQL port - leave blank for default port
$cfg['Servers'][$i]['password']      = implode ('', file ('../mysql_password')); // MySQL password (only needed
                                                    // with 'config' auth_type)
$cfg['Servers'][$i]['verbose']       = 'Uniform Server'; // Verbose name for this host - leave blank to show the hostname

Change to:

$cfg['Servers'][$i]['port']          = '3311';      // MySQL port - leave blank for default port
$cfg['Servers'][$i]['password']      = 'server11';  // MySQL password (only neededwith 'config' auth_type)
$cfg['Servers'][$i]['verbose']       = 'Mini 11';   // Verbose name for this host - leave blank to show the hostname

Top

phpMyAdmin block3

In the third block locates these lines:

$cfg['Servers'][$i]['port']          = '';          // MySQL port - leave blank for default port
$cfg['Servers'][$i]['password']      = implode ('', file ('../mysql_password')); // MySQL password (only needed
                                                    // with 'config' auth_type)
$cfg['Servers'][$i]['verbose']       = 'Uniform Server'; // Verbose name for this host - leave blank to show the hostname

Change to:

$cfg['Servers'][$i]['port']          = '3313';      // MySQL port - leave blank for default port
$cfg['Servers'][$i]['password']      = 'server13';  // MySQL password (only neededwith 'config' auth_type)
$cfg['Servers'][$i]['verbose']       = 'Mini 13';   // Verbose name for this host - leave blank to show the hostname

Top

List of servers

At the end of section three locate this section:

// If you have more than one server configured, you can set $cfg['ServerDefault']
// to any one of them to autoconnect to that server when phpMyAdmin is started,
// or set it to 0 to be given a list of servers without logging in
// If you have only one server configured, $cfg['ServerDefault'] *MUST* be
// set to that server.
$cfg['ServerDefault'] = 1;              // Default server (0 = no default server)
$cfg['Server']        = '';
unset($cfg['Servers'][0]);

And change the line $cfg['ServerDefault'] = 1; to $cfg['ServerDefault'] = 0;

// If you have more than one server configured, you can set $cfg['ServerDefault']
// to any one of them to autoconnect to that server when phpMyAdmin is started,
// or set it to 0 to be given a list of servers without logging in
// If you have only one server configured, $cfg['ServerDefault'] *MUST* be
// set to that server.
$cfg['ServerDefault'] = 0;              // Default server (0 = no default server)
$cfg['Server']        = '';
unset($cfg['Servers'][0]);

Start phpMyAdmin a drop down menu lists supported servers (Uniform Server, Mini 11 and Mini 13) select one to connect to.

Top

phpMyAdmin database

The main MySQL server contains a database named phpmyadmin this offers extra functionality. However the mini servers do not hence sections 2 and 3 need to be edited to remove this support. Alternatively you could export the database and import this to the two mini servers, the two sections would then remain as above.

If you do not wish to have this additional support modify each section. The two modified sections are shown below, I have removed some comments for clarity:

// ###### BLOCK 2 NEW SECTION
// The $cfg['Servers'] array starts with $cfg['Servers'][1].  Do not use $cfg['Servers'][0].
// You can disable a server config entry by setting host to ''.
$i++;
$cfg['Servers'][$i]['host']          = 'localhost'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port']          = '3311';      // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket']        = '';          // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type']  = 'tcp';       // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['extension']     = 'mysqli';    // The php MySQL extension to use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress']      = FALSE;       // Use compressed protocol for the MySQL connection
$cfg['Servers'][$i]['controluser']   = '';          // MySQL control user settings
$cfg['Servers'][$i]['controlpass']   = '';          // access to the "mysql/user"
$cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user']          = 'root';      // MySQL user
$cfg['Servers'][$i]['password']      = 'server11';  // MySQL password (only needed with 'config' auth_type)
$cfg['Servers'][$i]['only_db']       = '';          // If set to a db-name, only
$cfg['Servers'][$i]['verbose']       = 'Mini 11';   // Verbose name for this host - leave blank to show the hostname
$cfg['Servers'][$i]['pmadb']         = '';          // Database used for Relation, Bookmark and PDF Features
$cfg['Servers'][$i]['bookmarktable'] = '';          // Bookmark table
$cfg['Servers'][$i]['relation']      = '';          // table to describe the relation between links (see doc)
$cfg['Servers'][$i]['table_info']    = '';          // table to describe the display fields
$cfg['Servers'][$i]['table_coords']  = '';          // table to describe the tables position for the PDF schema
$cfg['Servers'][$i]['pdf_pages']     = '';          // table to describe pages of relationpdf
$cfg['Servers'][$i]['column_info']   = '';          // table to store column information
$cfg['Servers'][$i]['history']       = '';          // table to store SQL history
$cfg['Servers'][$i]['verbose_check'] = TRUE;        // set to FALSE if you know that your pma_* tables
$cfg['Servers'][$i]['AllowRoot']     = TRUE;        // whether to allow root login
$cfg['Servers'][$i]['AllowDeny']['order'] = '';     // Host authentication order, leave blank to not use
$cfg['Servers'][$i]['AllowDeny']['rules']= array(); // Host authentication rules, leave blank for defaults
// ###### END SECTION 

// ###### BLOCK 3 NEW SECTION
// The $cfg['Servers'] array starts with $cfg['Servers'][1].  Do not use $cfg['Servers'][0].
// You can disable a server config entry by setting host to ''.
$i++;
$cfg['Servers'][$i]['host']          = 'localhost'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port']          = '3313';      // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket']        = '';          // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type']  = 'tcp';       // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['extension']     = 'mysqli';    // The php MySQL extension to use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress']      = FALSE;       // Use compressed protocol for the MySQL connection
$cfg['Servers'][$i]['controluser']   = '';          // MySQL control user settings
$cfg['Servers'][$i]['controlpass']   = '';          // access to the "mysql/user"
$cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user']          = 'root';      // MySQL user
$cfg['Servers'][$i]['password']      = 'server13';  // MySQL password (only needed with 'config' auth_type)
$cfg['Servers'][$i]['only_db']       = '';          // If set to a db-name, only
$cfg['Servers'][$i]['verbose']       = 'Mini 13';   // Verbose name for this host - leave blank to show the hostname
$cfg['Servers'][$i]['pmadb']         = '';          // Database used for Relation, Bookmark and PDF Features
$cfg['Servers'][$i]['bookmarktable'] = '';          // Bookmark table
$cfg['Servers'][$i]['relation']      = '';          // table to describe the relation between links (see doc)
$cfg['Servers'][$i]['table_info']    = '';          // table to describe the display fields
$cfg['Servers'][$i]['table_coords']  = '';          // table to describe the tables position for the PDF schema
$cfg['Servers'][$i]['pdf_pages']     = '';          // table to describe pages of relationpdf
$cfg['Servers'][$i]['column_info']   = '';          // table to store column information
$cfg['Servers'][$i]['history']       = '';          // table to store SQL history
$cfg['Servers'][$i]['verbose_check'] = TRUE;        // set to FALSE if you know that your pma_* tables
$cfg['Servers'][$i]['AllowRoot']     = TRUE;        // whether to allow root login
$cfg['Servers'][$i]['AllowDeny']['order'] = '';     // Host authentication order, leave blank to not use
$cfg['Servers'][$i]['AllowDeny']['rules']= array(); // Host authentication rules, leave blank for defaults
// ###### END SECTION 

Conclusion

Uniform Server's architecture is very flexible a few changes and you can administer any number of MySQL servers. At first sight the phpMyAdmin configuration file looks intimidating if you break it just load a new copy.

I prefer using phpMyAdmin however command line clients can perform tasks that are impossible with phpMyAdmin.

Top


Ric