phpMyAdmin Explicit IP

Source: Internet
Author: User

The default installation of phpMyAdmin, usually only a MySQL server, the configuration information is stored in the phpMyAdmin configuration file, when we need to switch between multiple servers to log on, the change is very cumbersome. Following the configuration method, we can easily use phpMyAdmin to connect multiple MySQL

Method One: Enter the server IP address, user name, password when landing phpMyAdmin

Disadvantage: Login operation is cumbersome, and switch server must first exit the currently logged on server

Procedure: Modify the/libraries/config.default.php in the phpMyAdmin directory

/**
* Allow login to any user entered server in cookie based authentication
*
* @global boolean $cfg [' Allowarbitraryserver ']
*/
$cfg [' allowarbitraryserver '] = true;

The default value of False is modified to true;

In order to avoid the loss caused by the modification error, it is strongly recommended to back up the config.default.php file as Config.default.php.bak

Method Two: Login phpMyAdmin only need to enter the user name, password, server address for the drop-down list is optional, after landing can also select other servers to quickly switch. Recommended

Advantages: Easy to login, switch server after login without exiting the current connection.

Operation Steps:

1. Back up the config.sample.inc.php file in the phpMyAdmin root directory is Config.sample.inc.php.bak (this operation avoids the loss caused by the modification error)

2. Back up the config.inc.php file in the phpMyAdmin root directory is Config.inc.php.bak (this operation avoids the loss caused by the modification error)

3. Rename the config.sample.inc.php file under the phpMyAdmin root directory to config.inc.php

4. Modify the config.inc.php file to find the first server comments section and modify it to the following

$hosts = Array (
' 1 ' =>array (' host ' = ' localhost ', ' user ' = ' root ', ' password ' = ' 123456′ '),
' 2 ' =>array (' host ' = ' 192.168.0.1′ ', ' user ' = ' ciray ', ' password ' = ' 123456′ ')
);

$hosts array subscript Starting from 1, the value of host is the server IP address, user is the corresponding MySQL login username, password value for the MySQL login password, please change to your own

Two servers are configured $hosts array, and if you have more than one server, add the configuration information in the order in which the array is incremented
/*
* First Server
*/
for ($i =1; $i <=count ($hosts); $i + +) {

/* Authentication type */
$cfg [' Servers '] [$i] [' auth_type '] = ' cookie ';
/* Server Parameters */
$cfg [' Servers '] [$i] [' host '] = $hosts [$i] [' Host ']; Modify Host
$cfg [' Servers '] [$i] [' connect_type '] = ' TCP ';
$cfg [' Servers '] [$i] [' compress '] = false;
/* Select mysqli If your server has it */
$cfg [' Servers '] [$i] [' extension '] = ' mysql ';
$cfg [' Servers '] [$i] [' allownopassword '] = true;
$cfg [' Servers '] [$i] [' user '] = $hosts [$i] [' User ']; Modify User Name
$cfg [' Servers '] [$i] [' password '] = $hosts [$i] [' Password ']; Password
/* 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 ';

}
Note that we use a for loop to configure information for all servers, the initial value of the loop variable $i is 1, the configuration information in the $hosts array is traversed, and the contents of the loop body do not need to be changed.

After the modification is completed, save the file, re-login, if you can see the phpMyAdmin login interface appears in the server candidate list, indicating correct


This article is from the "Freeterman" blog, make sure to keep this source http://myunix.blog.51cto.com/191254/1675346

phpMyAdmin Explicit IP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.