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 charset utf8mb4_0900_ai_ci'; #150

Open
pinksuko opened this issue Sep 16, 2024 · 0 comments
Open

Client does not support charset utf8mb4_0900_ai_ci'; #150

pinksuko opened this issue Sep 16, 2024 · 0 comments

Comments

@pinksuko
Copy link

mysql: 8.4.2
code:

 function _M.new()
     local db, err = mysql:new()
     if not db then
        ngx.log(ngx.ERR, "failed to instantiate mysql: ", err)
        return nil, err
     end

     db:set_timeout(1000)   --1 second

     local ok, err = db:connect {
         host = "127.0.0.1",
         port = 3306,
         database = "master_db",
         user = "pinksuko",
         password = "suda.123",
		 charset = "utf8mb4",
		 max_packet_size = 1024 * 1024,
     }
	 
     if not ok then
	ngx.log(ngx.ERR, "failed to connect: ", err)
	return nil, err
      end

     return db

end

error.log:

failed to connect: charset 'utf8mb4_0900_ai_ci' is not supported
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

1 participant