I have a bunch of TDD code, including database tests and I've tried to upload to Github.
I've just checked on my local machine, every test are passed.
Also I'm trying to use Travis CI to check my tests are succeed or failed. My job log shows,
mysql -u root -e 'CREATE DATABASE worldCountries;'
mysql -u root -e "CREATE USER 'user45'@'localhost' IDENTIFIED BY 'user45';"
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'user45'@'localhost'
The command "mysql -u root -e "CREATE USER 'user45'@'localhost' IDENTIFIED BY 'user45';"" failed and exited with 1 during .
I have found a really similar question, but it didn't help me to solve the issue.
My travis.yml file is the following:
language: php
php:
- '5.6'
- '7.0'
- hhvm
services:
- mysql
dist: trusty
sudo: required
addons:
apt:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
before_script:
- mysql -u root -e 'CREATE DATABASE worldCountries;'
- mysql -u root -e "CREATE USER 'user45'@'localhost' IDENTIFIED BY 'user45';"
- mysql -u root -e "GRANT ALL ON worldCountries.* TO 'user45'@'localhost';"
- composer self-update
- composer install --prefer-source --no-interaction
script:
- vendor/bin/phpunit
- vendor/bin/phpmd src/ text phpmd.xml
I appreciate every answer!
-- Edit --
On my local machine, the mysql service works perfectly. All of my test passed green, and the database tests works fine.
With the same settings (as below travis.yml) I've tried to synchronize my repository in Travis, and I've received the failed report.