如何使用 phpMyAdmin 连接到您的 Prod/Dev 数据库? [英] How to connect to your Prod/Dev database using phpMyAdmin?

查看:15
本文介绍了如何使用 phpMyAdmin 连接到您的 Prod/Dev 数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的 local 环境中使用 phpMyAdmin 一段时间了.它带有 WAMP 服务器.我很喜欢.我想知道是否也可以将我的开发/生产服务器与它连接起来.

I’ve been using phpMyAdmin on my local environment for quit a while now. It comes with WAMP Server. I really like it. I was wondering if it’s possible to connect my dev/prod servers with it too.

到目前为止,我使用 MySQL WorkBench 已经有一段时间了.我不是很喜欢它.

As of now, I've using MySQL WorkBench for quite awhile now. I don't really like it that much.

如果有人对此有任何经验,我希望您不介意给我一些建议/建议以超越这一点.

If anyone have any experience with that, I hope you don’t mind give me some advice/suggestion to go above this.

推荐答案

phpMyAdmin 可以通过在 config.inc.php 中设置单个服务器连接详细信息来连接到多个服务器.您需要为每个服务器设置 $cfg['Servers'][$i] 数组.有关详细信息,请参阅 phpMyAdmin wiki:https://wiki.phpmyadmin.net/pma/Multiserver(这是以下示例的来源)

phpMyAdmin can connect to multiple servers by setting individual server connection details in config.inc.php. You need To set $cfg['Servers'][$i] arrays for each server. See the phpMyAdmin wiki for details: https://wiki.phpmyadmin.net/pma/Multiserver (which is where the example below is from)

$cfg['blowfish_secret']='multiServerExample70518';
//any string of your choice (max. 46 characters)
$i = 0;  

$i++; // server 1 :
$cfg['Servers'][$i]['auth_type'] = 'cookie'; // needed for pma 2.x
$cfg['Servers'][$i]['verbose']   = 'no1'; 
$cfg['Servers'][$i]['host']      = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysqli';
// more options for #1 ...

$i++; // server 2 :
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['verbose']   = 'no2'; 
$cfg['Servers'][$i]['host']      = 'remote.host.addr';//or ip:'10.9.8.1'
// this server must allow remote clients, e.g., host 10.9.8.%
// not only in mysql.host but also in the startup configuration
$cfg['Servers'][$i]['extension'] = 'mysqli';
// more options for #2 ... 

// end of server sections
$cfg['ServerDefault'] = 0; // to choose the server on startup

确保完全了解您在做什么以及您是如何连接的,您不想仅仅为了使用 phpMyAdmin 而向外界开放对您的数据库的访问.

Make sure to fully understand what you are doing and how you are connecting, you don't want to open access to your database to the outside world just to use phpMyAdmin.

这篇关于如何使用 phpMyAdmin 连接到您的 Prod/Dev 数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆