繁体   English   中英

我无法通过本地phpmyadmin访问远程mysql服务器

[英]I can't access remote mysql server via local phpmyadmin

我正在尝试通过本地phpmyadmin设置(从xampp安装)访问我的远程mysql服务器。 这是我的phpmyadmin的config.inc.php文件:

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'remote-mysql-server-username';
$cfg['Servers'][$i]['password'] = 'remote-mysql-server-pass';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true; 

// remote mysql server
$cfg['Servers'][$i]['verbose']       = 'remote mysql server';
$cfg['Servers'][$i]['host']          = 'some_website.com/';
$cfg['Servers'][$i]['port']          = '3306'; 
$cfg['Servers'][$i]['connect_type']  = 'tcp';
$cfg['Servers'][$i]['compress']      = FALSE;

我收到此错误:

hpMyAdmin 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.

您要连接的远程mysql服务器必须配置为允许或接受本地主机以外的请求。 检查防火墙是否允许端口3306(传入和传出)。

现在,我们将升级情况:

1)首先在mysql配置的my.ini中检查“ bind-address”指令,该指令应为0.0.0.0,以允许来自任何IP地址的连接。

2)其次,用户应具有我们正在访问的数据库的所有权限。

3)第三步,使phpmyadmin在localhost场景下工作,将其添加到phpmyadmin配置文件的末尾?>(tag)之前:

    /* Remote Server */
$i++;
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['host'] = 'myinstance.us-1.rds.amazonaws.com';//this is example enter your address
$cfg['Servers'][$i]['verbose'] = 'Remote Server Name';
$cfg['Servers'][$i]['user'] = '**********';
$cfg['Servers'][$i]['password'] = '**********'; 

现在登录localhost并从当前服务器中选择您的服务器名称,phpmyadmin将完成其余任务。

希望这会帮助你。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM