I am a new user of pipeline.
I really don't understand why I get the error "bash: mysql: command not found" with my pipeline script. The mysql client is well installed ?!
Is there someone to help me?
image: composer:2.0
definitions:
services:
mysql:
image: mysql:5.7
variables:
MYSQL_DATABASE: 'myDB'
MYSQL_ROOT_PASSWORD: 'root'
MYSQL_USER: 'myUser'
MYSQL_PASSWORD: 'mypwd'
pipelines:
default:
- step:
name: InstallMySQL
script:
- apt-get update && apt-get install -y mysql-client
- mysql -h 127.0.0.1 -u myUser -pmypwd -e "SHOW DATABASES"
services:
- mysql
For the records, I have managed to use mysql client in PHP images by installing mariadb-client like this:
image: php:8.0-apache
definitions:
services:
mysql:
image: mysql:5.7
variables:
MYSQL_DATABASE: 'myDB'
MYSQL_ROOT_PASSWORD: 'root'
MYSQL_USER: 'myUser'
MYSQL_PASSWORD: 'mypwd'
pipelines:
default:
- step:
name: InstallMySQL
script:
- apt-get update && apt-get install -y mariadb-client
- mysql -h 127.0.0.1 -u myUser -pmypwd -e "SHOW DATABASES"
services:
- mysql
Welcome to the Atlassian Community!
This suggests that your build environment does not have a path defined that includes the directory that apt is installed in, or you are running it on a system that doesn't use apt for its package management. (The "path" I mean here is the list of directories a process looks in for executables when asked to run something)
apt is usually installed in /usr/bin, and you will need to have admin rights to run it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much for your answer. OK I was using the default image suggested by Bitbucket pipeline creation interface for a PHP project, which doesn't permit to use APT apparently.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In fact, the error comes from the installation command "bash: apt-get: command not found". But I don't understand how to fix this error.
Any idea?
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.