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

TypeOrmModule: Unable to connect to the database #19

Closed
mhabsaoui opened this issue Jun 29, 2019 · 2 comments
Closed

TypeOrmModule: Unable to connect to the database #19

mhabsaoui opened this issue Jun 29, 2019 · 2 comments

Comments

@mhabsaoui
Copy link

mhabsaoui commented Jun 29, 2019

Hi,
I am trying to make NestJs web-app to connect to a Mysql DB running in a docker container.

ormconfig.json :

{
  "type": "mysql",
  "host": "localhost",
  "port": 3306,
  "username": "root",
  "password": "rootpass",
  "database": "nestjsrealworld",
  "entities": ["src/**/**.entity{.ts,.js}"],
  "synchronize": true
}

The docker command I am using to run mysql container instance :
docker run --rm --name nest-mysql -p3306:3306 -e MYSQL_ROOT_PASSWORD=rootpass -e MYSQL_DATABASE=nestjsrealworld -d mysql

The problem I get is it cannot to DB :/

[Nest] 18963   - 2019-07-02 2:35 PM   [TypeOrmModule] Unable to connect to the database. Retrying (1)... +97ms
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client

I have checked on the Mysql container logs it is ready for connections...

Thanks for your help.

@mhabsaoui
Copy link
Author

Ok, I had to use a previous version mysql:5.7.26 to make it connect.

@cirosantilli
Copy link

I'd keep this open, since upgrading this repo to newer mysql is a valid feature request.

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