Im running an application running React, python and MySQL with a docker compose, When I run the application everything works fine, but when a pettition to the database (from the frontend with axios) is made multiple times, the connection breaks and the following error appears. Everything is running locally
"2055: Lost connection to MySQL server at 'database:3306', system error: 8 EOF occurred in violation of protocol (_ssl.c:2483)"
Here is the configuration of my connection and my dockerfile
import mysql.connector
return mysql.connector.connect(
host=os.environ.get("database"),
user="root",
password="root",
database="locatec",
port=3306,
auth_plugin='mysql_native_password'
)
database:
image: mysql
container_name: database
restart: always
ports:
- '3306:3306'
#command: --init-file /init.sql
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- ~/apps/mysql:/var/lib/locatec5
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: test
MYSQL_PASSWORD: test
MYSQL_ROOT_HOST: '%'
TIMEZONE: UTC
networks:
- locatec
server:
build:
context: ../../../
dockerfile: infra/deploy/backend/dev/Dockerfile
restart: always
ports:
- "5000:5000"
container_name: server
networks:
- locatec
depends_on:
- database
I tried using
mysql-connector-python==8.0.30
, also I configured the param of ssl to false
/var/lib/locatec5looks odd and no/var/lib/mysqlmount point.