外部数据库上的phpMyAdmin配置

时间:2012-08-09 00:33:03

标签: php mysql phpmyadmin

  

可能重复:
  connect to external server by using php myAdmin

我的网站主机在不同的服务器上提供数据库,因此“localhost”不适合我。如何设置phpMyAdmin配置存储以使用外部服务器?

我试过了: $cfg['Servers'][$i]['pmadb'] = 'dbname.dbserver.host.com';$cfg['Servers'][$i]['pmadb'] = 'dbname@dbserver.host.com';

但那些没有用。有什么建议吗?

这是我的设置......
FreeBSD 7.3-RELEASE-p2
阿帕奇/ 2.2.22
MySQL 5.0.91-log
mysqlnd 5.0.8-dev
phpMyAdmin 3.5.2.1
使用配置身份验证

我将配置数据库的设置放入config.inc.php中常规非配置数据库的配置块中,使用类似的方法可以正常工作:

$cfg['Servers'][$i]['verbose'] = 'pma';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'dbuser';
$cfg['Servers'][$i]['password'] = 'dbpass';
$cfg['Servers'][$i]['only_db'] = array('dbname');
$cfg['Servers'][$i]['host'] = 'dbserver.host.com';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysqli';

1 个答案:

答案 0 :(得分:0)

$cfg['Servers'][$i]['host'] = 'dbserver.host.com'; // use host (I removed dbname.)

编辑1

测试直接连接:

mysql --host=dbserver.host.com --user=*** --password=***

您的设置应该有效。否则请求支持。 (需要SSL连接?,安全证书?等)