0
votes

my Travis build fails with this error

php bin/console doctrine:database:create --env=test In AbstractMySQLDriver.php line 93:
An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'db_user'@'localhost' (using password: YES)

Here is my travis.yml

# Project language
language: php

# Allows use container-based infrastructure
sudo: false

# Start mysql service
services:
  - mysql

# Cache composer packages so "composer install" is faster
cache:
  directories:
    - $HOME/.composer/cache/files

# Matrix to test in every php version
matrix:
  # Fast finish allows to set the build as "finished" even if the "allow_failures" matrix elements are not finished yet.
  fast_finish: true
  include:
    - php: 7.3.5
    - php: hhvm
  allow_failures:
    - php: hhvm

# Define an environment variable
env:
  - SYMFONY_VERSION="4.7.*" DB=mysql

# Update composer
before-install:
  - composer self-update

# Install composer dependencies,
# Create database, schema and fixtures
install:
  - composer install
  - php bin/console doctrine:database:create --env=test
  - php bin/console doctrine:schema:create --env=test
  - php bin/console doctrine:fixtures:load -n --env=test

# Run script
script:
  - phpunit

# After a build, send email notification with the build results
notifications:
  email: [email protected]          

Thanks for your help.

1

1 Answers

0
votes

I think the error is obvious Access denied for user 'db_user'@'localhost' (using password: YES) :)

Did you check that the user for mysql service in Travis CI is travis or root? (check also the password)