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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Could not connect to mysql service with Bitbucket Pipelines Edited

 

Pipeline error stack:

Traceback (most recent call last):

  File "/usr/local/lib/python3.6/unittest/loader.py", line 428, in _find_test_path module = self._get_module_from_name(name)

  File "/usr/local/lib/python3.6/unittest/loader.py", line 369, in _get_module_from_name __import__(name)

  File "/opt/atlassian/pipelines/agent/build/tests.py", line 8, in <module> db = MySQLdb.connect(**settings.TEST_DATABASE)

  File "/usr/local/lib/python3.6/site-packages/MySQLdb/__init__.py", line 85, in Connect return Connection(*args, **kwargs)

  File "/usr/local/lib/python3.6/site-packages/MySQLdb/connections.py", line 204, in __init__ super(Connection, self).__init__(*args, **kwargs2)

  _mysql_exceptions.OperationalError: (1045, "Access denied for user 'test_user'@'127.0.0.1' (using password: YES)")

 

bitbucket-pipelines.yml:

image: nikolaik/python-nodejs:python3.6-nodejs8

pipelines:
default:
- step:
name: Python + JS unit tests
caches:
- docker
- pip
- node
script:
- cp -n settings_example.py settings.py
- python -V
- pip install --upgrade pip
- pip install -r requirements.txt
- python -m unittest discover
services:
- docker
- mysql

definitions:
services:
mysql:
image: mysql:5.6
environment:
MYSQL_DATABASE: pipelines
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
MYSQL_USERNAME: test_user
MYSQL_PASSWORD: test_user_password

 

 

settings.py:


TEST_DATABASE = {
"host": "127.0.0.1",
"user": "test_user",
"password": "test_user_password",
"database": "pipelines"
}

 

 

I use example for mysql user from How to run common databases in Bitbucket Pipelines

It seems to be easy to setup but and I confused. What is my mistake?

1 answer

1 accepted

0 votes
Answer accepted
Peter Plewa Atlassian Team Sep 02, 2019

Hi @Oleksandr Zaitsev

Sorry for delayed response, did you manage to resolve your issue or could you provide me information with the current state of your pipeline? There are number of articles on how to connect to mysql service, is any of those helpful?

https://community.atlassian.com/t5/forums/searchpage/tab/message?advanced=false&allow_punctuation=false&q=pipelines+mysql

Thanks,
Peter

Like Peter Plewa likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,218 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you