UNIX socket connection fails with access denied when caching_sha2_password is set. #4452
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
samples
Issues that are directly related to samples.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
In which file did you encounter the issue?
cloudsql/mysql/database-sql/connect_unix.go
Did you change the file? If so, how?
No files have been changed.
Describe the issue
Following this tutorial: https://cloud.google.com/sql/docs/mysql/connect-instance-cloud-run#go
With two changes:
caching_sha2_password
database flagINSTANCE_CONNECTION_NAME
env var.I run into an error where the application is unable to authenticate to the database using the Unix socket.
Steps to reproduce:
Navigating to the app it's unable to load
Checking the logs we see
Access denied
Workaround
A work around I found to this (aside from not using caching_sha2_password) is to manually authenticate to the SQL database using the cloud sql connector.
https://cloud.google.com/sql/docs/mysql/connect-auth-proxy
I would like to be able to use the UNIX socket auth with
caching_sha2_password
because of the security and flexibility that option provides.If there is a better place to post this issue happy to move it.
The text was updated successfully, but these errors were encountered: