Dinesh Belkare
Dinesh Belkare

Reputation: 631

Not able to connect MySQL database from remote server on Amazon EC2 server

  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.

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

Upvotes: 0

Views: 1298

Answers (1)

Dinesh Belkare
Dinesh Belkare

Reputation: 631

Remote db connection is working now.

I run following command on remote server(Server2)

setsebool -P httpd_can_network_connect_db=1

Upvotes: 0

Related Questions