Use phpmyadimn to connect and manage multiple databases _ PHP Tutorial

Source: Internet
Author: User
Use phpmyadimn to connect and manage multiple databases. Phpmyadimn is used to connect and manage multiple databases. phpmyadimn is used to connect to and manage multiple databases. it is difficult to modify the configuration file, and the connection speed is not good. You can use phpmyadimn to connect to and manage multiple databases.
It is uncomfortable to use phpmyadimn to connect to and manage multiple databases and modify the configuration file. In addition, it cannot be used to connect to a remote database. You can use other database management tools,

For more information, see navicat. it is very easy to use with shortcuts, open source, and mysql management tool HeidiSQL. If you have to use phpmyadmin, there are two ways to connect and manage multiple mysql servers.

Method 1: modify phpMyAdmin/libraries/config. default. php

Before modifying the configuration file, you 'd better back up the file first. if the configuration file cannot be displayed, it will be depressing.

/**

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

*

* @ Global boolean $ cfg ['allowarbitraryserver']

*/

$ Cfg ['allowarbitraryserver'] = true; // The default value is false. change it to true.

Before modification, the input box on the server does not exist. if it is set to true, it is displayed. then, you can connect to multiple different databases. However, this modification has one drawback,

If you switch between multiple databases, you need to exit and log on again. this is annoying. See the following method.

Method 2: manage multiple mysql servers at the same time.

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

2. modify the config. inc. php file.

/*

* First server

*/

// To manage more mysql servers, modify the $ connect_hosts array.

$ 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'] = 'cooker ';

/* Server parameters */

$ Cfg ['servers'] [$ I] ['host'] = $ connect_hosts [$ I] ['host']; // modify the host

$ Cfg ['servers'] [$ I] ['connect _ type'] = 'tcp ';

$ Cfg ['servers'] [$ I] ['compus'] = 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 the 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 should not start from 0. Otherwise, an error will be prompted. invalid server Index: "0"

Before logon,

Phpmyadmin modify config. inc. php multi-server login

After logging on,

Phpmyadmin connects to multiple mysql servers.

Note that after you log on with localhost and select 192.168.0.11 from the drop-down list, you will also be logged on. after you log on to all servers, you will not be logged on when switching between multiple servers.

Using phpmyadimn to connect and manage multiple databases it is uncomfortable to modify the configuration file and connect to a remote database. You can use...

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.