Docker Community Forums

Share and learn in the Docker community.

MySQL container - I can INSERT but not SELECT from another container

  • Issue type: Potential network issue
  • OS Version/build: Amazon Linux 2
  • App version: 19.03.6-c
  • Steps to reproduce

I have two containers running (php:7.3.3-apache & mysql:5.7) both assigned to the same network.

When I try to access the MySQL database from the apache container I can perform INSERT and UPDATE but I can’t run any SELECT statements, nothing gets returned.

#from inside the apache container I can insert/update but NOT select, not even queries like SELECT NOW() work
mysqli(‘test_mysql’, ‘root’, ‘password’, ‘mydatabase’);

#from outside of the apache container on the host machine I CAN preform all actions
mysqli(‘0.0.0.0:41001’, ‘root’, ‘password’, ‘mydatabase’);

Has anyone saw this before?