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

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

How to configure parallel steps with a MySQL database


I'm developping a CakePHP application. The application has about 1500 tests which take about 4 hours to run sequentially. Therefore I want to use parallel pipelines to run 10 tests at the same time.

CakePHP tests create, delete and empty tables on most of the tests, so when alle 10 pipelines this can be a problem, when 1 test is using a table and the other one deletes it. 

I've configured the 10 pipelines and written a custom PHP script that generates a PHPUnit test-suite for each of these 10 pipelines. Each test suite sets a DB_NAME environment variable so each pipeline can run on another database. I've added custom PHP code to create the database when it does not exists.

Locally, everything works perfect. However, when running the tests in Bitbucket pipelines I get the error: "Access denied for user 'testuser'@'%' to database 'test6'". So the default user can't create new databases next to the default "pipelines" database. And the documentation mentions no other users and also mentions that the root user is not available. 


How can I fix this so I can run parallel tests? Waiting 4 hours to finish testing is not an option.

1 answer

0 votes

Hi kvgysegh,

Are you running the MySQL database as a service inside Pipelines? Can you post your bitbucket-pipelines.yml configuration file (with any sensitive information redacted)? Note that if you're using Pipelines services, each step will get a separate whole service, ie. a separate whole MySQL instance, so there is no need to use different database names within MySQL.

Suggest an answer

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

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

3,808 views 64 20
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