简体   繁体   English

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

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

I'm trying to access my remote mysql server via my local phpmyadmin setup(from xampp installation). 我正在尝试通过本地phpmyadmin设置(从xampp安装)访问我的远程mysql服务器。 Here is my config.inc.php file for phpmyadmin: 这是我的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;

I get this error: 我收到此错误:

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.

the remote mysql server that you want to connect has to be configured to allow or take request other than localhost. 您要连接的远程mysql服务器必须配置为允许或接受本地主机以外的请求。 Check firewall is allowing port 3306 (both incoming and outgoing). 检查防火墙是否允许端口3306(传入和传出)。

Now we will escalate the situation: 现在,我们将升级情况:

1) First check in my.ini of mysql configuration the "bind-address" directive it should be 0.0.0.0 to allow connections from any IP address. 1)首先在mysql配置的my.ini中检查“ bind-address”指令,该指令应为0.0.0.0,以允许来自任何IP地址的连接。

2) second the user should have all permission for the database we are accessing. 2)其次,用户应具有我们正在访问的数据库的所有权限。

3) third make the phpmyadmin work in localhost scenario, add this in the end of your phpmyadmin config file before ?>(tag): 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'] = '**********'; 

Now login in localhost and select from the current server drop down your server name, phpmyadmin will do rest of task. 现在登录localhost并从当前服务器中选择您的服务器名称,phpmyadmin将完成其余任务。

Hope this will help you. 希望这会帮助你。

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

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