0

I had a mysql admin issue with permissions on % hosts.

  1. EC2_DB launched with IP 10.55.142.100 and DNS ip-10-55-142-100.ec2.internal
  2. EC2_web launched with IP 10.55.142.144 and DNS ip-10-55-142-144.ec2.internal
  3. EC2_DB and EC2_WEB are in the same security group with access across the DB port (3306)
  4. EC2_DB has a mysql DB that can be reached locally and fully administered by the DB root user.
  5. EC2_DB mysql DB has a remote user 'my_user'@'%' IDENTIFIED BY PASSWORD 'password'
  6. A bash call to mysql from EC2_WEB fails: mysql -umy_user -p -h ip-10-55-142-100.ec2.internal, as does host references to the explicit IP, public DNS, etc.

Step 6 seems to fail because the mysql DB has the wrong user permisions. It needed this:

GRANT ALL PRIVILEGES ON *.* TO 'my_user'@'ip-10-55-142-144.ec2.internal' IDENTIFIED BY PASSWORD 'password'

I would like to think that % would work for any remote server, but I did not find this to be the case.


Please let me know why I cannot use % here.

As it stands now, I will need to add the host-specific permissions for every client in my cluster, which is much more overhead (despite the improved security)

New Alexandria
  • 6,951
  • 4
  • 57
  • 77

0 Answers0