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

Client does not support authentication protocol requested by server; consider upgrading MySQL client: 1251 08004 #147

Open
ckall opened this issue Jan 30, 2024 · 1 comment

Comments

@ckall
Copy link

ckall commented Jan 30, 2024

code:

  local mysql = require("resty.mysql")
  local db, err = mysql:new()
    if not db then
        return 500, { message = "failed to instantiate mysql: " .. err }
    end
    db:set_timeout(1000)
    local ok,errcode, sqlstate
     ok, err, errcode, sqlstate = db:connect{
        host = "127.0.0.1",
        port = 3306,
        database = "apisix_test",
        user = "root",
        password = "apisixrootpassword"
        charset = "utf8",
        max_packet_size = 1024 * 1024,
    }
    if not ok then
        return 500, { message = "failed to connect: " .. err .. ": " .. errcode .. " " .. sqlstate }
    end

resp:

{
    "message": "failed to connect: Client does not support authentication protocol requested by server; consider upgrading MySQL client: 1251 08004"
}

How can I solve it?
Does it feel like an issue with the latest version of MySQL?

@zhuizhuhaomeng
Copy link
Contributor

Which version of MySQL server do you use?

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