Open Bilal05476 opened 11 months ago
Hi, can you tell me more about your other configuration too? What is the MySQL port you selected?
Hi, can you tell me more about your other configuration too? What is the MySQL port you selected? port no : 3306
Use the below code for docker-compose.yml it will fix above error : version: '3.9' services:
flask-app: container_name: 'flask-python-application' build: context: . ports:
'5000:5000' environment: MYSQL_HOST: 'mysql-db' MYSQL_USER: 'root' MYSQL_PASSWORD: 'root' MYSQL_DB: 'devops' depends_on: mysql-db: condition: service_healthy
mysql-db: container_name: 'mysql-db' image: 'mysql:5.7' ports:
volumes: mysql-volume-data:
OperationalError MySQLdb.OperationalError: (2002, "Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)")
Both containers in same network but above error persist