使用本地phpMyAdmin通过Xampp连接到远程数据库

时间:2014-10-20 09:36:28

标签: phpmyadmin xampp database-connection remote-access

我是初学者,所以请耐心等待我。

我希望使用phpMyAdmin Xampp从localhost访问和使用客户端远程数据库服务器。从我在线搜索,我知道我需要更改文件config.inc.php中的代码,如下所示。

$i++;
/* Server parameters */
$cfg['Servers'][$i]['host'] = '';                       //server host name or IP
$cfg['Servers'][$i]['connect_type'] = 'tcp';            
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['Servers'][$i]['user'] = '';                       //Account username
$cfg['Servers'][$i]['password'] = '';                   //Account password
$cfg['Servers'][$i]['auth_type'] = 'config';

但是在我改变之后我得到了一些错误消息。

#1045 - Access denied for user (using password: YES) 

Connection for controluser as defined in your configuration failed.

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

我遇到了类似的情况,发现我应该在数据库中创建一个新用户。但是我在改变后又遇到了另一个错误。

#1129 - Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 

Connection for controluser as defined in your configuration failed.

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

我不知道如何解决这个问题,并希望你们中的一些人可以提供一些建议。感谢。

抱歉我的英语不好。

3 个答案:

答案 0 :(得分:0)

此错误与您发布的config.inc.php相关的有趣之处在于错误消息表明$cfg['Servers'][$i]['controluser']$cfg['Servers'][$i]['controlpass']指令存在问题 - 在您发布的文件中没有设置。 controluser是由phpMyAdmin管理的管理用户,允许您访问一些高级选项;它不是必需的,我建议跳过它,直到你的基本配置工作。我建议使用工具(例如grep)来查找文本的其他提及' controluser'查看是否有xampp使用的另一个文件干扰了你的config.inc.php。

phpMyAdmin当然可以连接到远程MySQL实例,但大多数系统管理员不允许这样做(通过在防火墙或直接从MySQL阻止传入的TCP请求)。我想知道你是否受到类似保护的影响。

  

1129 - 由于许多连接错误,主机被阻止;使用' mysqladmin flush-hosts'

取消阻止

这意味着连接时出现了太多错误;你需要在主机上运行命令mysqladmin flush-hosts(在命令/ shell提示符下;而不是MySQL提示符下)来清除它。

答案 1 :(得分:0)

您应该添加访问主机 转到您的c-panel并单击Remote MySql并通过提供IP

添加访问主机

答案 2 :(得分:-1)

我使用 MySQL Workbench ,它更易于使用,使我们无需访问其Cpanel即可在客户端数据库上工作。

可以查看MySQL Workbench以获取更多信息。