Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/253.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我无法通过本地phpmyadmin访问远程mysql服务器_Php_Mysql_Linux_Apache_Phpmyadmin - Fatal编程技术网

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

我无法通过本地phpmyadmin访问远程mysql服务器,php,mysql,linux,apache,phpmyadmin,Php,Mysql,Linux,Apache,Phpmyadmin,我正在尝试从xampp安装通过本地phpmyadmin设置访问我的远程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']

我正在尝试从xampp安装通过本地phpmyadmin设置访问我的远程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在本地主机场景中工作,请在phpmyadmin配置文件的末尾添加以下内容:

    /* 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将完成其余任务


希望这对您有所帮助。

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

现在我们将使局势升级:

1首先在mysql配置的my.ini中检查bind address指令,它应该是0.0.0.0,以允许从任何IP地址进行连接

2秒,用户应该拥有我们正在访问的数据库的所有权限

3第三,要使phpmyadmin在本地主机场景中工作,请在phpmyadmin配置文件的末尾添加以下内容:

    /* 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将完成其余任务


希望这能对您有所帮助。

明显的问题是服务器、端口和密码等是否正确。那么,您能否验证与phpmyadmin之外的数据库(比如通过ncat)的连接?是的,它们是正确的,因为我通过web应用程序和ssh连接到我的mysql服务器。明显的问题是服务器、端口和密码等是否正确。然后,您可以验证phpmyadmin之外的数据库连接(比如通过ncat)吗?是的,它们是正确的,因为我通过web应用程序和ssh连接到mysql服务器。是的,它是端口3306。我是一个AmazonLinuxEC2服务,在控制台中检查它是端口3306。我是一个AmazonLinuxEC2服务,并在控制台中进行了检查