您的位置:首页 > 编程语言 > PHP开发

Access multiple databases through PhpMyadmin

2016-06-07 14:02 471 查看

Overview

PhpMyadmin has the ability to access multiple MySQL or MariaDB, includes local or remote machines.

In this article, we describe it in briefly.

Reference

https://wadsashika.wordpress.com/2015/01/06/manage-remote-mysql-database-locally-using-phpmyadmin/#more-57

The default case

After installation, phpmyadmin has only one database configuration, see phpmyadmin/config.inc.php.

In this case, the UI is as below:



Add another db server

Reference

see: phpMyAdmin/doc/html/config.html#server-connection-settings or Server Connection Settings.

Example

In the end of config.inc.php, add the configuration: – The user, password, port, host, ect, should be changed according your requirement or environment.

/*
* Another DB server
*/
$i++;
$cfg['Servers'][$i]['user'] = 'admin';
$cfg['Servers'][$i]['password'] = 'admin';
$cfg['Servers'][$i]['port'] = 3306;
$cfg['Lang'] = '';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';

/*
* End of servers configuration
*/

?>


UI

After changing, save the config.inc.php. Then refresh (F5) the phpmyadmin page in the browser. Then there will show a list with which to choose you instrested server. – If the configuration is error, phpmyadmin will occur some error.

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  phpmyadmin remote database