为了通过本地phpMyAdmin客户端访问远程服务器而配置了phmpMyAdmin时发生错误 [英] Error from phmpMyAdmin when is configured in order to access remote server with local phpMyAdmin client

查看:114
本文介绍了为了通过本地phpMyAdmin客户端访问远程服务器而配置了phmpMyAdmin时发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了访问远程数据库,我已经编辑了config.inc.php,并在其末尾的?>之前添加了:

In order to access to a remote database I have edited config.inc.php and at the end of it, before the end ?> I have added :

$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

但是当我使用浏览器连接时,出现以下错误消息:

but when I connect using browser I have this error message:

./libraries/common.inc.php#1204中的通知未定义变量:i

Notice in ./libraries/common.inc.php#1204 Undefined variable: i

回溯

./phpmyadmin.css.php#14:require_once(./libraries/common.inc.php)

./phpmyadmin.css.php#14: require_once(./libraries/common.inc.php)

版本为:

PHP 5.4.16 Development Server
phpMyAdmin 4.4.15.10
MySQL 5.6.32 - MySQL Community Server (GPL)

phpMyAdmin无需配置common.inc.php

phpMyAdmin works well with local database, without configure common.inc.php

common.inc.php中间有一条指令unset($i),但是如果common.inc.php的末尾不再可用,该如何使用i变量呢?

In the middle of common.inc.php there's this instruction unset($i), but how can I use the i variable a the end of common.inc.php if it is no longer available ?

我已经以此方式初始化

$i=2;

现在我看到一个带有服务器名称的下拉菜单,但是当我选择其中一个时,它将返回到本地主机.

now I see a drop down menu with server name, but when I selected one of them it returns to localhost.

使用mysql命令连接到远程数据库服务器,并使用相同的用户名/密码,我可以成功连接到数据库服务器.

Using mysql command to connect to the remote database server and using the same user/password, I can successfully connect to the database server.

在客户端服务器上,我正在使用Linux,在远程服务器上,我正在使用Windows 7

On client server I'm using Linux, on remote I'm using Windows 7

我仅在推荐答案

这是一个

It's a Notice that occurs when you access a variable that is not defined. In your case the variable is $i.

定义首先如下

$i = 0;

然后在其余代码中使用它.

Then use it in rest of your code.

这篇关于为了通过本地phpMyAdmin客户端访问远程服务器而配置了phmpMyAdmin时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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