LondheShubham153 / two-tier-flask-app

126 stars 1.4k forks source link

Operation Error while connecting flask app to mysql #16

Open Bilal05476 opened 1 year ago

Bilal05476 commented 1 year ago

OperationalError MySQLdb.OperationalError: (2002, "Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)")

Screenshot from 2023-10-07 17-08-11

Both containers in same network but above error persist

sitchatt commented 1 year ago

Hi, can you tell me more about your other configuration too? What is the MySQL port you selected?

Sudarshankevat commented 8 months ago

Hi, can you tell me more about your other configuration too? What is the MySQL port you selected? port no : 3306

pratiksha-design261 commented 3 months ago

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:

volumes: mysql-volume-data:

Iam-Tej23 commented 1 month ago

please use mysql ip in two-tier-app-deployment.yaml file so that it work fine.