Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

登入時出現error #16

Closed
yuanqiuye opened this issue Jul 24, 2020 · 2 comments
Closed

登入時出現error #16

yuanqiuye opened this issue Jul 24, 2020 · 2 comments
Labels
good first issue Good for newcomers

Comments

@yuanqiuye
Copy link

yuanqiuye commented Jul 24, 2020

[INFO] API: Main - [UID: -1] POST /api/auth/login
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
at Handshake.Sequence._packetToError (/usr/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Handshake.ErrorPacket (/usr/app/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)
at Protocol._parsePacket (/usr/app/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/usr/app/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/usr/app/node_modules/mysql/lib/protocol/Parser.js:43:10)
at Protocol.write (/usr/app/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/usr/app/node_modules/mysql/lib/Connection.js:88:28)
at Socket. (/usr/app/node_modules/mysql/lib/Connection.js:523:10)
at Socket.emit (events.js:314:20)
at Socket.EventEmitter.emit (domain.js:548:15)
--------------------
at Protocol._enqueue (/usr/app/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Protocol.handshake (/usr/app/node_modules/mysql/lib/protocol/Protocol.js:51:23)
at Connection.connect (/usr/app/node_modules/mysql/lib/Connection.js:116:18)
at /usr/app/node_modules/knex/lib/dialects/mysql/index.js:68:18
at new Promise ()
at Client_MySQL.acquireRawConnection (/usr/app/node_modules/knex/lib/dialects/mysql/index.js:63:12)
at create (/usr/app/node_modules/knex/lib/client.js:289:39)
at processTicksAndRejections (internal/process/task_queues.js:93:5)

想請問一下如何解決這個問題QQ,使用docker配置的,docker-compose ps如下:

  Name                     Command                  State               Ports

core_javclub_1 docker-entrypoint.sh node ... Up 0.0.0.0:1234->3000/tcp
core_mysql_1 /entrypoint.sh --default-a ... Up (healthy) 3306/tcp, 33060/tcp
core_phpmyadmin_1 /docker-entrypoint.sh apac ... Up 0.0.0.0:8080->80/tcp

外部nginx配置:

server {
listen 80;
server_name my_domain;
root /heihei/JAVClub_docker/core/wwwroot/JAVClub_web/dist;

location / {
    try_files $uri $uri/ /index.html;
}

location ^~ /api {
    proxy_pass http://0.0.0.0:1234;
    proxy_set_header   X-Forwarded-Proto $scheme;
    proxy_set_header   Host              $http_host;
    proxy_set_header   X-Real-IP         $remote_addr;
}
# 其他如default

}

感謝!

@LynMoe
Copy link
Contributor

LynMoe commented Jul 24, 2020

Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client

现在因为使用 Sequence 组件,所以 MySQL 服务器需要使用 caching_sha2_password 插件而不是 mysql_native_password, 请更改后再尝试

另外你这 Nginx 配置写的 http://0.0.0.0:1234 还能跑起来有点迷啊...

@yuanqiuye
Copy link
Author

謝謝作者的回復,已經能跑起來了,開心www

@LynMoe LynMoe added the good first issue Good for newcomers label Jul 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants