我一直在寻找一个正确的答案,没有运气的解决方案。我的本地主机上有WampServer和phpMyAdmin。我在远程服务器上用phpmyadmin创建了一个拥有所有权限的用户。连接本地phpMyAdmin与远程服务器 - 错误#2002
-
文件夹WAMP /应用/ phpmyadmin4.1.14 /我已经找到config.inc.php文件
并试图将其与下面的代码连接到远程数据库:
<?php
$i++;
/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$i++;
/* Authentication type */
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'username';
$cfg['Servers'][$i]['password'] = 'mypass';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'example.com';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
?>
因此,现在我在phpMyAdmin中有第二台服务器,但是当我选择它时 - 弹出错误。 MySQL错误#2002看起来像这样:
2002 - 连接尝试失败,因为连接方在一段时间后没有正确响应,或者建立的连接失败,因为连接的主机未能响应。服务器没有响应(或本地服务器的套接字配置不正确)。
请帮我想念什么!
是 - 我想两个连接,一个为本地主机和一个对我的远程服务器。我已经在phpMyAdmin中为远程服务器(example.com)创建了一个拥有所有权限的用户,并且正在使用此用户名和密码。 那么,你认为这是用户名/密码和privilages的问题? 只是要补充,它是共享主机,我想连接 - 所以,成千上万的人成功做到了这一点:) – mpavlovic89 2015-02-07 10:17:43
是的,这将是特权,因为phpmyadmin通过mysql连接,它需要正确的权限设置为远程访问。只要该帐户可以远程连接,那么这些帐户详细信息将与phpmyadmin一起使用。 – lukesUbuntu 2015-02-07 10:20:47
没有运气 - 我已经在服务器上创建了一个拥有所有privilages的用户。 – mpavlovic89 2015-02-07 10:22:26