假设有一台远程服务器,并且我在本地计算机上安装了phpMyAdmin客户端。如何通过phpMyAdmin客户端访问和管理此服务器?这有可能吗?
发布于 2014-02-28 18:31:08
只需在底部的/etc/phpmyadmin/config.inc.php
文件中添加以下行:
$i++;
$cfg['Servers'][$i]['host'] = 'HostName:port'; //provide hostname and port if other than default
$cfg['Servers'][$i]['user'] = 'userName'; //user name for your remote server
$cfg['Servers'][$i]['password'] = 'Password'; //password
$cfg['Servers'][$i]['auth_type'] = 'config'; // keep it as config
你会得到一个带有127.0.0.1
的Current Server:
下拉菜单,还有一个你用$cfg['Servers'][$i]['host']
提供的可以在服务器之间切换的东西。
更多细节:http://sforsuresh.in/access-remote-mysql-server-using-local-phpmyadmin/
发布于 2014-04-24 21:50:11
正如其他答案所指出的,从phpMyAdmin的本地实例访问远程MySQL服务器当然是可能的。为此,您必须对MySQL正在侦听的端口号执行configure the remote server's MySQL server to accept remote connections操作,并允许流量通过防火墙。我更喜欢与SSH Tunnelling略有不同的解决方案。
以下命令将设置SSH隧道,该隧道将从本地计算机向远程计算机上的端口3306转发所有对端口3307的请求:
ssh -NL 3307:localhost:3306 root@REMOTE_HOST
出现提示时,应输入远程计算机上root用户的密码。这将打开隧道。如果您希望在后台运行此命令,则需要添加-f
参数,并在本地计算机和远程计算机之间设置Passwordless SSH。
在使SSH通道工作之后,可以通过修改/etc/phpmyadmin/config.inc.php
文件将远程服务器添加到本地phpMyAdmin的服务器列表中。将以下内容添加到文件的末尾:
$cfg['Servers'][$i]['verbose'] = 'Remote Server 1'; // Change this to whatever you like.
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '3307';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['compress'] = FALSE;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$i++;
我写了一个关于这个的更深入的blog post,以防你需要额外的帮助。
发布于 2013-05-29 05:15:46
您可以在phpMyAdmin安装的config.inc.php文件中设置。
$cfg['Servers'][$i]['host'] = '';
https://stackoverflow.com/questions/16801573
复制相似问题