0

I'm trying the test of the program with django & mysql on travis-ci, but raise that error.

pymysql.err.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")

my .travis.yml is

language: python

python:
  - '3.6'

services:
  - mysql

matrix:
  include:
    - os: osx
      language: generic
      sudo: required

env:
  - DJANGO=1.11 DB=mysql

before_install:
  - brew update       
  - brew install python3
  - virtualenv env -p python3
  - source env/bin/activate
  - brew install mysql

install:
  - pip install -r requirements.txt

before_script:
  - mysql.server start

script:
  - cd <my_django_project>
  - python manage.py test

In the test, it went well until $cd <my_django_project> and returns The command "cd <my_django_project>" exited with 0.

But $python manage.py test raises that error

pymysql.err.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")

Also, when use my local Terminal, $python manage.py test raises no error and normally pass the test.

I looked up the existing question, but this information is probably old.

what can I do?

Thanks.

jijiji
  • 1
  • 1
  • See if this answers your question: https://stackoverflow.com/questions/17975120/access-denied-for-user-rootlocalhost-using-password-yes-no-privileges – Cory Madden Jul 18 '17 at 01:37
  • *this information is probably old*. Or maybe not. Did you read it and try what it suggested? What happened when you did? What about the several dozen other questions that contain the same error message? Did you read them? – Ken White Jul 18 '17 at 01:49

1 Answers1

0

Is root DB guest user?

If yes, from your DB admin user, grant root to access MySQL environment table 'mysql.user' as follow:

GRANT SELECT ON mysql.user TO 'root'@'%';

To me it worked, Ivan

Ivan Gruer
  • 21
  • 4