New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access denied for user 'travis'@'%' to database (trusty and mysql) #8331

Closed
sue445 opened this Issue Sep 2, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@sue445

sue445 commented Sep 2, 2017

I'm using weekly build on travis.

Last week build was successful.
https://travis-ci.org/sue445/index_shotgun/jobs/268298728

But, this week build is failure.
https://travis-ci.org/sue445/index_shotgun/jobs/271175914

Mysql2::Error: Access denied for user 'travis'@'%' to database 'index_shotgun_test': CREATE DATABASE `index_shotgun_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
/home/travis/build/sue445/index_shotgun/gemfiles/vendor/bundle/ruby/2.1.0/gems/mysql2-0.4.9/lib/mysql2/client.rb:120:in `_query'
/home/travis/build/sue445/index_shotgun/gemfiles/vendor/bundle/ruby/2.1.0/gems/mysql2-0.4.9/lib/mysql2/client.rb:120:in `block in query'
/home/travis/build/sue445/index_shotgun/gemfiles/vendor/bundle/ruby/2.1.0/gems/mysql2-0.4.9/lib/mysql2/client.rb:119:in `handle_interrupt'
/home/travis/build/sue445/index_shotgun/gemfiles/vendor/bundle/ruby/2.1.0/gems/mysql2-0.4.9/lib/mysql2/client.rb:119:in `query'

Setting for to connect to mysql is following. (via. https://docs.travis-ci.com/user/database-setup/#Using-MySQL-with-ActiveRecord)

test:
  adapter: mysql2
  database: index_shotgun_test
  username: travis
  encoding: utf8

I think that it is caused by changing from precise to trusty.
Successful build was precise and failed build was trusty. (code is no changed!)

Has the setting to connect between precise and trusty changed?
Or is this a problem with travis-ci?

Thank you.

Workaround

Add dist: precise to .travis.yml

#.travis.yml
dist: precise

My build was successful.
https://travis-ci.org/sue445/index_shotgun/builds/271184012

@mloskot

This comment has been minimized.

Show comment
Hide comment
@mloskot

mloskot Sep 5, 2017

I can confirm this issue.

We are experiencing the same problem in SOCI project:


UPDATE: Work around the problem by explicitly grant privileges to travis userL

mysql -u root -e "CREATE DATABASE mydb;"
mysql -u root -e "GRANT ALL PRIVILEGES ON mydb.* TO 'travis'@'%';";

Credits to @php-coder

mloskot commented Sep 5, 2017

I can confirm this issue.

We are experiencing the same problem in SOCI project:


UPDATE: Work around the problem by explicitly grant privileges to travis userL

mysql -u root -e "CREATE DATABASE mydb;"
mysql -u root -e "GRANT ALL PRIVILEGES ON mydb.* TO 'travis'@'%';";

Credits to @php-coder

MichalKatuscak added a commit to gephart/orm that referenced this issue Sep 5, 2017

mloskot added a commit to mloskot/soci that referenced this issue Sep 5, 2017

Switch Travis CI to Ubuntu Trusty (latest environment)
Update/Remove outdated PPA repositories.
Corret Firebird post-installation steps to set password correctly.
Grant MySQL privileges to travis user explicitly (see travis-ci/travis-ci#8331)

tvdeyen added a commit to tvdeyen/solidus_i18n that referenced this issue Sep 13, 2017

Build on precise because of Travis MySQL problems
Travis recently switched to trusty build environment but broke
MySQL builds by removing database create privileges.

See: travis-ci/travis-ci#8331

tvdeyen added a commit to tvdeyen/solidus that referenced this issue Sep 13, 2017

Run mysql builds as root on TravisCI
If running our builds (including extensions) we need to run our MySQL builds with root user.
This is necessary because of latest changes to the build environment.

See: travis-ci/travis-ci#8331
@stale

This comment has been minimized.

Show comment
Hide comment
@stale

stale bot Apr 13, 2018

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

stale bot commented Apr 13, 2018

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

@stale stale bot added the stale label Apr 13, 2018

@stale stale bot closed this Apr 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment