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

问题描述:

我是初学者,所以请耐心等待。使用本地phpMyAdmin通过Xampp连接远程数据库

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

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

对不起,我英文很差。

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

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

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

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

+0

感谢您的称赞。我使用了另一种方法。 – Eelyn 2014-11-07 09:06:38

我使用MySQL Workbench取而代之,它更容易使用,使我们能够在不访问其Cpanel的情况下处理客户端数据库。

可以检查MySQL Workbench了解更多信息。