Visitar URL original
Support `caching_sha2_password` authentication plugin with Proxy in Unix Socket mode · Issue #2317 · GoogleCloudPlatform/cloud-sql-proxy · GitHub
Skip to content

Support caching_sha2_password authentication plugin with Proxy in Unix Socket mode #2317

Description

@jackwotherspoon

The Cloud SQL Proxy currently does not support the caching_sha2_password authentication plugin when listening over a unix socket.

This is an issue as in MySQL 8.4, caching_sha2_password has now become the default authentication plugin. Any new database users created with the caching_sha2_password will be unable to log in via the Proxy over unix socket.

Failed logins are not always clear that the authentication plugin is the root cause of the issue:

ERROR 1045 (28000): Access denied for user 'my-user'@'cloudsqlproxy~34.124.164.49' (using password: YES)

Some Cloud SQL Language Connectors are a viable alternative and workaround at the moment as they work with MySQL 8.4 and the caching_sha2_password plugin:

Unfortunately, the Java connector does not work with MySQL 8.4. We are actively working on a fix for the Java connector also.

Activity

  1. added
    priority: p0Highest priority. Critical issue. P0 implies highest priority.
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    on Oct 29, 2024
  2. changed the title [-]Support `cachine_sha2_password` authentication plugin with Proxy in Unix Socket mode[/-] [+]Support `caching_sha2_password` authentication plugin with Proxy in Unix Socket mode[/+] on Oct 30, 2024
  3. simon-peek-poke commented on Jan 31, 2025

    @simon-peek-poke

    Hi @jackwotherspoon is there an ETA on a fix for this? We're looking to update our MySQL 5.7 databases to 8.4 but are being blocked by this bug because it's affecting App Engine connections to Cloud SQL. We use PHP so can't use the connector workaround.

  4. jackwotherspoon commented on Jan 31, 2025

    @jackwotherspoon
    CollaboratorAuthor

    is there an ETA on a fix for this? We're looking to update our MySQL 5.7 databases to 8.4 but are being blocked by this bug because it's affecting App Engine connections to Cloud SQL. We use PHP so can't use the connector workaround.

    @simon-peek-poke I know the MySQL team is actively working on the fix to this.

    Let me reach out and see if they can provide me with an ETA. Will report back 😄

  5. dantheperson commented on Feb 4, 2025

    @dantheperson

    As a workaround connect once with tcp, and then you can connect with sockets.
    Another workaround is to connect once with GCP consoles new "Cloud SQL Studio"

    daniel@legski:~$ mysql -h 127.0.0.1 --port 3307 -u dantest2 -p
    Enter password: 
    ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
    
    daniel@legski:~$ mysql -h 127.0.0.1 --port 3307 -u dantest2 -p --get-server-public-key 
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 47942
    Server version: 8.4.3-google (Google)
    
    Copyright (c) 2000, 2025, Oracle and/or its affiliates.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql> exit
    Bye
    
    $ mysql -S ~/cloudsql/xxxx\:australia-southeast1\:store-dev2-0-a18cc097 -u dantest2 -p
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 49911
    Server version: 8.4.3-google (Google)
    
    Copyright (c) 2000, 2025, Oracle and/or its affiliates.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql> 
    
    
  6. dantheperson commented on Feb 5, 2025

    @dantheperson

    From further research it seems that workaround is only temporary due to some server caching mecahanism.

  7. jackwotherspoon commented on Feb 5, 2025

    @jackwotherspoon
    CollaboratorAuthor

    From further research it seems that workaround is only temporary due to some server caching mechanism.

    @dantheperson Yes the caching_sha2_password authentication plugin will cache secure connections for a given period, which is why your workaround works temporarily. However, as you mentioned once the cache entry expires then the full authentication would be required on the next connection attempt.

    I have escalated this issue internally to the MySQL team and they are hoping to get the fix out for it ASAP.

  8. dantheperson commented on Feb 9, 2025

    @dantheperson

    Does this issue affect accounts with access via IAM Group authentication, or does it only affect native/built-in database users?

  9. jackwotherspoon commented on Feb 10, 2025

    @jackwotherspoon
    CollaboratorAuthor

    Does this issue affect accounts with access via IAM Group authentication, or does it only affect native/built-in database users?

    @dantheperson I believe this issue should only affect native/built-in database users.

    IAM database users (IAM user, service account, groups etc.) all go through their own different authentication flow.

  10. copyrighthero commented on Apr 2, 2025

    @copyrighthero

    Hi there! I'm wondering if there is a timeline for resolving this issue?

  11. jackwotherspoon commented on Apr 2, 2025

    @jackwotherspoon
    CollaboratorAuthor

    Hi there! I'm wondering if there is a timeline for resolving this issue?

    @copyrighthero Yes, although I can't provide a specific date but I can detail the plans.

    For caching_sha2_password support over unix sockets we require changes to the Cloud SQL Proxy client (this repo), the Cloud SQL Proxy Server (runs on the Cloud SQL VM alongside the database engine), and the Cloud SQL for MySQL database engine.

    Due to these changes they require several rollouts which will take some time, the tentative completion based on this would be some time in Q3.

  12. 9 remaining items

  13. added a commit that references this issue on Oct 29, 2025
    6ff8753
  14. vinthara commented on Dec 22, 2025

    @vinthara

    Since the issue is closed, I assume that it is not in testing anymore but has been released in the 2.19.0 version

    However I am having an issue still :

    mysql -u <user> -P 3306 -h 127.0.0.1 -p  

    Output :

    ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
    

    My cloud-sql-proxy version :

    cloud-sql-proxy --version
    

    Output :

    cloud-sql-proxy version 2.20.0
    

    cloud-sql-proxy with the --debug-logs flag :

    2025/12/22 10:56:02 [instance] Cert is valid = true
    2025/12/22 10:56:02 [instance] Dialing xx.xx.xx.xxx:3307
    2025/12/22 10:56:02 dial successful
    2025/12/22 10:56:02 [instance] Reading MDX response...
    2025/12/22 10:56:02 MDX Read: No MDX response, first 1 bytes do not match MDX signature. %!v(MISSING)
    2025/12/22 10:56:02 [instance] Writing MDX request, protocol:TCP...
    2025/12/22 10:56:02 [instance] MDX request sent successfully.
    2025/12/22 10:56:02 [instance] IO Error on Read or Write: read tcp xx.x.x.x:xxxxxx->xx.xx.xx.xxx:3307: use of closed network connection
    
  15. s-paquette commented on Feb 25, 2026

    @s-paquette

    We recently updated to MySQL 8.4 on our dev servers and are still seeing this as well. With the added problem of Google now warning for added charges on maintaining MySQL 8.0 instances, this is a serious problem for us.

    (1045, "Access denied for user 'my-user'@'cloudsqlproxy~34.56.zzz.xxx' (using password: YES)")

    Has this been rolled out? If so, is there a reason an App Engine Flex deployment using the proxy would still be running into it?

  16. dantheperson commented on Feb 26, 2026

    @dantheperson
  17. s-paquette commented on Feb 26, 2026

    @s-paquette

    Although it's a year out, I prefer not to cut things close. As mentioned above we already upgraded one database and now have to roll it back due to inability to use it in 8.4 on App Engine Flex, unless we want to write our own custom solution to get Django to connect to it (Django doesn't officially support PyMySQL, which is what the CloudSQL Python Connector supports, so we can't use the connector unless we want to implement our own engine as a workaround).

  18. henkmollema commented on Jul 8, 2026

    @henkmollema

    What is the status of this issue? We're having issues connecting from Cloud Run to MySQL 8.4 instances from .NET over Unix sockets (no cloud connector available) with users using caching_sha2_password.

  19. karlmacklin commented on Jul 9, 2026

    @karlmacklin

    I think the idea is to not migrate to 8.4 yet, stay on 8.0 to maintain functionality.
    Not ideal of course but Google is not seeing this as a priority.

    More discussions have been had at google discuss:
    https://discuss.google.dev/t/cloud-run-cant-connect-to-mysql-after-google-cloud-sql-maintenance/187391/5
    At that time october 2025 was the expected (hopeful?) timeline for a fix. There might perhaps be some miscommunication around this issue that keeps it in limbo.

  20. henkmollema commented on Jul 9, 2026

    @henkmollema

    Very odd that Google is pushing us to upgrade to MySQL 8.4 (since 8.0 is moving to extended support next year) while this bug is not getting fixed.

  21. s-paquette commented on Jul 9, 2026

    @s-paquette

    App Engine Flex has been upgraded to the new proxy (2.0) as of a couple of weeks ago so it's been taken care of; this might? have fixed App Engine Standard as well, though I have no deployment in standard which uses MySQL with which I can confirm that.

    If you're still seeing the error in Cloud Run then they've not yet migrated that to the 2.0 proxy, is my guess (you can often confirm this by looking in the logs for the deprecation warning when the deployment first goes live).

  22. panavenue commented on Jul 9, 2026

    @panavenue
    Contributor

    Hi all, thank you for bringing this to our attention.

    @s-paquette: Just to make sure I understand, are you able to successfully connect using a Unix socket with Proxy v2? I am curious, which version of the Auth Proxy are you currently using?

    @karlmacklin: Hi Karl. To help us investigate this further, could you clarify your specific application environment and how the Auth Proxy/client is being used in your setup? Thanks!

  23. s-paquette commented on Jul 9, 2026

    @s-paquette

    @panavenue Yes, we've been able to use UNIX sockets with auth proxy v2 on App Engine Flex to connect to a MySQL 8.4 CloudSQL instance. (In our specific case we can't use the Python Connector because it doesn't support Django.) We use the default Auth Proxy provided in AppEngine Flex, which has been v1 (and was showing a deprecation warning for some time now upon deployment) until recently. It seems to have been updated to v2, at least for our orgs and projects; it's possible this hasn't been a wide release yet and you may need to contact Google to get it done, if they're still testing it before full availability.

  24. karlmacklin commented on Jul 15, 2026

    @karlmacklin

    @panavenue
    It's just Wordpress running as Cloud Run function.

    So it's PHP. I believe Wordpress uses php mysqli to initiate mysql connection. Just the basic standard way of connecting to a mysql server from PHP.

    The connection "host" string looks like this, anonymized:
    :/cloudsql/${projectname}:europe-north1:${mysqlservername}

    Works fine until the server gets maintenance/restarts. Then all connections are impossible to initiate. Until you manually connect via the gui in google cloud or - IIRC - using a mysql client like HeidiSQL/similar. That revives the connection and it works until next maintenance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: p0Highest priority. Critical issue. P0 implies highest priority.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions