Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

why do i get suddenly an access denied in the mysql bitbucket pipeline?

David Michael Gang April 26, 2018

This looks crazy but suddenly my bitbucket pipelines started to fail because access denied.

pymysql.err.OperationalError: (1045, "Access denied for user 'example-user'@'127.0.0.1' (using password: NO)")

 

Here is my bitbucket-pipelines.yaml file:

 


# This is a sample build configuration for Python.
# Check our guides at https://confluence.atlassian.com/x/x4UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: python:3.6.4

pipelines:
  default:
    - step:
        caches:
          - pip
        script: # Modify the commands below to build your repository.
          - pip install pipenv
          - pipenv install --dev --system --deploy
          - export DB_USERNAME=example-user && export DB_PASSWORD=example-user
          - python -c 'import os;print(os.environ.get("DB_PASSWORD"))'
          - coverage run --source=predictor --omit=predictor/* -m unittest
          - coverage report -m
        services:
          - mysql


definitions:
  services:
    mysql:
      image: mysql
      environment:
        MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
        MYSQL_DATABASE: 'database1'
        MYSQL_USER: 'example-user'
        MYSQL_PASSWORD: 'example-user'

I can confirm that the environment variable is printed. How can i debug the issue further?

1 answer

0 votes
Marvin Heilemann July 5, 2022

Did you got it working?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events