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

Couldn't locate driver named mysql with PHPUnit and Bamboo OnDemand

Jean-Sebastien (GA) June 10, 2014

Hi,

I'm a new customer of Bamboo OnDemand, I want to use it to test/deploy PHP projects.

So I set up a PHPUnit 3.7 test task.

The testing obviously includes access to our mysql database, but the build fails as the mysql driver seems not being present in the Bamboo PHP environment. I got the error 'Couldn't locate driver named mysql' in the build log .

How can i fix this ?

thanks for any help !

4 answers

1 accepted

0 votes
Answer accepted
Jean-Sebastien (GA) June 22, 2014

thank you Przemek :)

Im going to investigate the Atlassian documentation about how to setup an instance script then.

best regards,

J

1 vote
FelipeA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 10, 2014

Hi Jean-Sébastien,

I'm assuming you're on a Linux environment.

Probably you don't have the php-mysql driver instaled, you can check that by running:

php --ri pdo

If you don't see mysql listed at PDO drivers, then that's the case.

To solve this:

If you're on a debian based distribution:

sudo apt-get install php5-mysql

If you're on a Red Hat based distribution:

yum -y install php-mysql

After that, check again the output of php --ri pdo command.

Best regards,

Felipe Alencastro

0 votes
Jean-Sebastien (GA) June 20, 2014

Ok so, after reading some extra documentation, from what I understand now is that what I need here is to add the "MySQL" capabilities to my elastic agent.

And that could be done

either by creating a custom elastic image (but then you loose the Atlassian support, which is quite contradictory to the willing of having an OnDemand account which should buy you some confort and impediments instead...)

or you configure an EBS volume to add some script that would install MySQL on your instance (but it is not perfect solution since I need to checkout the whole repository for each build job, because I want a clean build, which it is not what EBS are really intended for. But It is problably the best workaround I found so far (still have to experiment it though).

hence the question : is there or will there be a Linux Elastic Image with the MySql capabilty, that allow us, for example, to run PHPUnit test against a MySql database ?

Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 22, 2014

The best option is to use an instance setup script.

0 votes
Jean-Sebastien (GA) June 11, 2014

Hi Felipe, thank you for the follow-up of my question :)

I detect a slight misunderstanding here, let me clarify (sorry if I've not been clear enough :) ) :

The PHPUnit task I'm talking about is the one selected from the list of available Bamboo tasks, and, as I'm running Bamboo OnDemand, I guess this piece of software runs on some elastic agent from the Amazon cloud.

Therefore, the error I got ("no mysql driver") comes from here, apparently , not from our Linux servers where mysql and pdo driver do exist). If you see what I mean ?

So, from my understanding (but I'm quite a newbie in Bamboo world here ;) ) it's more like the Elasic Bamboo image was lacking this important driver, isn't it ? I'm surprised though. but then I wonder how to fix this

best regards, JS

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events