Use PHPMYADIMN to connect to manage multiple databases

Source: Internet
Author: User
Tags phpmyadmin

Use PHPMYADIMN to connect to manage multiple databases to modify the configuration file, it is very uncomfortable, and connect to the remote database, speed is not. You can use other database administration tools,

Please refer to, navicat combination shortcut key very good, open source, use MySQL management tool heidisql. If you want to use phpMyAdmin, there are two ways to connect and manage multiple MySQL servers.


Method One, modify phpmyadmin/libraries/config.default.php


Before modifying the configuration file, it is best to back up, in case the wrong place, can not show, depressed.


/**

* Allow login to any user entered server in cookie based authentication

*

* @global boolean $cfg [' Allowarbitraryserver ']

*/

$cfg [' allowarbitraryserver '] = true; Default is False, change to True


Before the modification, the server this input box does not exist, become true after the display, you can connect a number of different databases. But there is one drawback to this modification,

If you switch between multiple databases, you should exit and log back in, which is annoying, look at the following method.


Method Two, manage multiple MySQL servers at the same time.


1, rename the config.sample.inc.php under the phpMyAdmin root directory to config.inc.php


2. Modify the config.inc.php file


/*

* First Server

*/

If you want to manage more MySQL servers, modify the $connect_hosts array on the line.

$connect _hosts = Array (

' 1 ' =>array (

"Host" = "localhost",//server 1

"User" = "root",

"Password" = "" "

),

' 2 ' = = Array (

"Host" = "192.168.0.11",//server 2

"User" = "WordPress",

"Password" = "*******"

)

);

for ($i =1; $i <=count ($connect _hosts); $i + +) {

/* Authentication type */

$cfg [' Servers '] [$i] [' auth_type '] = ' cookie ';

/* Server Parameters */

$cfg [' Servers '] [$i] [' host '] = $connect _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 '] = $connect _hosts[$i] [' User ']; Modify User Name

$cfg [' Servers '] [$i] [' password '] = $connect _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 the array subscript does not start at 0, or it will prompt the wrong, Invalid server index: "0"


Before logging in,


phpMyAdmin modifying config.inc.php multiple server logins


After logging in,


phpMyAdmin connect multiple MySQL servers, log in


One thing to note, after you log in with localhost, select the dropdown in the 192.168.0.11, you will also let you log in, after logging in, in multiple servers This switch will not be logged in.


This article is from the "→おyǒňɡ Zhi ℃" blog, please be sure to keep this source http://sxlfxx.blog.51cto.com/4244111/1707706

Use PHPMYADIMN to connect to manage multiple databases

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.