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

时间:2017-05-06 03:32:04

标签: php mysql linux apache phpmyadmin

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

library(data.table)
setDT(s)[, paste("mean =", mean(age), "sd =", sd(age)), flavor]$V1

我收到此错误:

/* 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;

1 个答案:

答案 0 :(得分:0)

要连接的远程mysql服务器必须配置为允许或接受localhost以外的请求。  检查防火墙是否允许端口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将执行其余任务。

希望这会对你有所帮助。

相关问题