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

问题描述 投票:0回答:2

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

我希望使用 phpMyAdmin Xampp 从本地主机访问客户端远程数据库服务器并在其上工作。根据我在网上搜索的内容,我知道我需要更改文件 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.

我不知道如何解决这个问题,希望你们中的一些人能给我一些建议。谢谢。

抱歉我的英语不好。

phpmyadmin xampp database-connection remote-access
2个回答
0
投票

此错误与您发布的 config.inc.php 相结合的有趣之处在于,错误消息表明

$cfg['Servers'][$i]['controluser']
$cfg['Servers'][$i]['controlpass']
指令存在问题——这些指令未在您发布的文件中设置。 controluser 是由 phpMyAdmin 管理的管理用户,可让您访问一些高级选项;这不是必需的,我建议跳过它,直到您的基本配置正常工作。我建议使用工具(例如 grep)来查找文本“controluser”的其他提及,看看是否有 xampp 使用的另一个文件干扰了您的 config.inc.php。

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

1129 - 由于许多连接错误,主机被阻止;使用“mysqladminlush-hosts”解锁

这意味着连接时发生了太多错误;您需要在主机上运行命令

mysqladmin flush-hosts
(在命令/shell 提示符下;而不是 MySQL 提示符下)来清除内容。


0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.