Failed to connect MySQL database from remote server on Amazon EC2 server

  • I am using MySql Version 5.7.17 with centos-7 in an AWS EC2 instance ( Server1 )
  • I added the entry "bind-address = 0.0.0.0" to "/etc/my.cnf"
  • Added inbound rule in security group for port 3306 from 0.0.0.0/0
  • A new user is added and assigned all privileges with the following requests
  • GRANT ALL PRIVILEGES. TO bob @ '%' identified by password;
  • PRIVILEGES OF FLUSH;
  • Another instance of EC2 ( Server2 ) resides on the same VPC.

However, I cannot connect the MySQL database from the remote server ( Server2 ) to the server ( Server1 ).

0
mysql amazon-web-services amazon-ec2 centos
Feb 08 '17 at 11:54 on
source share
1 answer

Remote db connection now works.

I run the following command on a remote server ( Server2 )

setsebool -P httpd_can_network_connect_db = 1

0
Feb 09 '17 at 7:31
source share



All Articles