Skip to content
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

cannot connect to db #680

Closed
marcosdipaolo opened this issue Oct 26, 2020 · 2 comments
Closed

cannot connect to db #680

marcosdipaolo opened this issue Oct 26, 2020 · 2 comments

Comments

@marcosdipaolo
Copy link

marcosdipaolo commented Oct 26, 2020

Hi, my app is using a dockerized db which exposes port 3306 to the outside world, so it's basically the same as mysql installed locally as a service.

My API is connecting with no problems to the database. It uses thus data:

DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=root

but when passing the app to supertest and making a request i get:

"Access denied for user 'root'@'172.17.0.1' (using password: NO)"

i wonder why it isn't connecting to the db as the app does?

It's an node api built with node, express and sequelize

@marcosdipaolo
Copy link
Author

I was not aware that jest sets the NODE_ENV variable even if you have it set in the .env file

@bilalesi
Copy link

can you exaplain the solution, i am facing the same issue !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants