无法从Amazon EC2服务器上的远程服务器连接MySQL数据库 [英] Not able to connect MySQL database from remote server on Amazon EC2 server

查看:149
本文介绍了无法从Amazon EC2服务器上的远程服务器连接MySQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. 我在AWS EC2实例( Server1 )上使用带有centos-7的MySql版本5.7.17
  2. 我在"/etc/my.cnf"中添加了条目"bind-address = 0.0.0.0"
  3. 在安全组中为0.0.0.0/0的端口3306添加了入站规则
  4. 添加了新用户并通过以下查询分配了所有权限
  5. 上授予所有特权.以'password'标识的bob @'%';
  6. 平常特权;
  7. 另一个EC2实例( Server2 )在同一VPC上.
  1. I am using MySql Version 5.7.17 with centos-7 on AWS EC2 Instance(Server1)
  2. I have added entry "bind-address=0.0.0.0" in "/etc/my.cnf"
  3. Added inbound rule in security group for port 3306 with 0.0.0.0/0
  4. Added new user and assigned all privileges with following queries
  5. GRANT ALL PRIVILEGES ON . TO bob@'%' identified by 'password';
  6. FLUSH PRIVILEGES;
  7. Another EC2 instance(Server2) is on same VPC.

仍然,我无法将MySQL数据库从远程服务器( Server2 )连接到服务器( Server1 ).

Still,I am not able to connect MySQL database from remote server(Server2) to server(Server1).

推荐答案

远程数据库连接现在正在工作.

Remote db connection is working now.

我在远程服务器( Server2 )

setsebool -P httpd_can_network_connect_db = 1

这篇关于无法从Amazon EC2服务器上的远程服务器连接MySQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆