Docker Mysql Lost Connection to Mysql Server at 'reading Initial Communication Packet

Docker -> Building a LAMP stack

When in doubt, split them out.

The DockerFiles

          repository_name:tag_name        
          ENV DEBIAN_FRONTEND=noninteractive        
          /path/to/local/file.txt /path/to/container/filepath/file.txt        

Building the prototype

          docker-etch build        
          docker-compose -f /path/to/docker-etch.yml/file build        

The docker-compose.yml

How to turn on the containers

          docker-composer up        
          docker-etch -f /path/to/docker-compose.yml/file build        

How to Connect to a MySQL container with PHP

          mysqli_connect("container_name_here", "my_user", "my_password", "my_db");        
          mysqli_connect("devmysql", "my_user", "my_password", "my_db");        

Troubleshooting Tips

Terminal Thoughts

rustinlopurth.blogspot.com

Source: https://medium.com/code-kings/docker-building-a-lamp-stack-9503c62d9214

0 Response to "Docker Mysql Lost Connection to Mysql Server at 'reading Initial Communication Packet"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel