My bitbucket-pipelines.yml file is showing a error :"_mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")".
pipelines: default: - step: image: python:3.5.2 services: - database script: - pip install -r requirements.txt - python manage.py run_test definitions: services: database: image: mysql environment: MYSQL_DATABASE: 'pipelines' MYSQL_ROOT_PASSWORD: 'let_me_in'
Above is my code.Thanks in advance
I ran into this problem. For me the fix was to use '0.0.0.0' instead of 'localhost' in Django as the database HOST. The Atlassian docs clearly state to use localhost, so I believe they are wrong.
Yes, this is definitely a the fix. Maybe they are wrong in the docker network setup of the pipeline.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This worked for me too! Atlassian should really fix their docs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The usual reasons for that error are that MySQL is not running, or it is configured with a different socket file. Check your my.cnf for it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.