Unable to allow remote mysql access

I’ve provisioned an AWS instance with trellis, what I want is to allow some remote user to access MySQL.

I found that in order to allow remote mysql access you need to:

  1. Create a mysql user@ip with privileges over the wordpress db.
  2. Flush privileges
  3. Open port 3306 in AWS secutiry groups
  4. Open port 3306 in iptables
  5. Modify my.cnf bind-address to allow remote IP
  6. Restart mysql

I followed these steps, but it didnt work, im getting connection timed out.

In my group_vars/all/security.yml I’ve added

-type: dport_accept
dport: [3306]
filename: mysql_accept

Thats not the way to modify iptables with trellis/ansible/ferm ?

I know this isn’t an answer to your exact question. But if you’re using AWS why aren’t you using RDS for your database? I highly recommend using that over a local MySQL instance.

Your ferm addition looks fine at first glance. But with AWS you’d probably also need to allow that port in your EC2 security group.

ja… just realized I can’t ping my elastic IP, trying to connect using my domain seems to work, now I’m getting Access denied error which means I did something wrong with mysql privileges.

trellis disables IP access to the server? why?

Disables what kind of access?

Using the server IP, I was unable to ping, telnet or access my server using the IP