Plusieurs serveurs MySQL avec phpMyAdmin

Gérer plusieurs serveurs MySQL  avec phpMyAdmin

La configuration par défaut de phpMyAdmin permet de se connecter uniquement au serveur MySQL local, mais si vous avoez plusieurs serveurs de base de données en cours d’exécution, ce serait bien si nous pouvions choisir le serveur à partir duquel nous devions nous connecter depuis phpMyAdmin.  Afin que nous puissions sélectionner le serveur de base de données dont nous avons besoin pour nous connecter à partir de l’interface web.

Après avoir installé phpMyAdmin sur vos systèmes Linux / Windows, utilisons ceci pour gérer plusieurs serveur MySQL avec phpMyAdmin.

Accédez d’abord au répertoire d’installation de phpMyAdmin. L’emplacement du répertoire peut être différent avec votre méthode d’installation. Dans la plupart des cas, nous pouvons le trouver sur le répertoire / usr / share / phpMyAdmin ou / usr / share / phpmyadmin.

 

# vi /var/www/html/phpMyAdmin/config.inc.php

#skip-networking
#bind-address = 127.0.0.1
bind-address = 0.0.0.0

 

/*
* Premier serveur
*/
$i = 0;
$i++;
$cfg[‘Servers’][$i][‘host’]          = ‘localhost‘; // hostname or IP address
$cfg[‘Servers’][$i][‘port’]          = ”;          //  port – leave blank for default port
$cfg[‘Servers’][$i][‘socket’]        = ”;          // Path to the socket – blank for default socket
$cfg[‘Servers’][$i][‘connect_type’]  = ‘tcp’;       // How to connect to server (‘tcp’ or ‘socket’)
$cfg[‘Servers’][$i][‘extension’]     = ‘mysql’;     // 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’]          = ‘user‘;      // MySQL user
$cfg[‘Servers’][$i][‘password’]      = ‘passwd’;          // MySQL password (only needed
$cfg[‘Servers’][$i][‘only_db’]       = ”;          // If set to a db-name, only
$cfg[‘Servers’][$i][‘verbose’]       = ”;          // 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’]           // Host authentication rules, leave blank for defaults
= array();

/*
* Deuxième serveur
*/
$i++;
$cfg[‘Servers’][$i][‘host’]          = ‘192.168.xxx.xxx’; // 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’]     = ‘mysql’;     // 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 cookie)
$cfg[‘Servers’][$i][‘user’]          = ‘dev’;      // MySQL user
$cfg[‘Servers’][$i][‘password’]      = ‘passwd’;          // MySQL password (only needed
$cfg[‘Servers’][$i][‘only_db’]       = ”;          // If set to a db-name, only
$cfg[‘Servers’][$i][‘verbose’]       = ”;          // 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’]
= ”;
$cfg[‘Servers’][$i][‘AllowDeny’][‘rules’]           // Host authentication rules, leave blank for defaults
= array();

 

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée.

* Copy This Password *

* Type Or Paste Password Here *