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



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

我希望使用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.

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

抱歉我英语不好。

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

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

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

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

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

最新更新