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?
code:
resp:
How can I solve it? Does it feel like an issue with the latest version of MySQL?