Skip to content

Unable to connect to DB via Google's cloud_sql_proxy #1350

@keltaklo

Description

@keltaklo

Since upgrading to v1.38.4 on 2025-09-17, I've been unable to connect to remote Cloud SQL databases via Google's cloud_sql_proxy. This worked on my previously installed version (unclear which version that is - it was older than #1311, as that's why I upgraded. If anyone can advise on how to find older installed version info from Homebrew, I can let you know).

Checking the logfile, it looks like something might be going wrong passing the password via the connection? The error thrown is:

File "/usr/local/Cellar/mycli/1.38.4/libexec/lib/python3.13/site-packages/mycli/main.py", line 478, in _connect
    self.sqlexecute = SQLExecute(
                      ~~~~~~~~~~^
        database,
        ^^^^^^^^^
    ...<13 lines>...
        init_command,
        ^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/Cellar/mycli/1.38.4/libexec/lib/python3.13/site-packages/mycli/sqlexecute.py", line 143, in __init__
    self.connect()
    ~~~~~~~~~~~~^^
  File "/usr/local/Cellar/mycli/1.38.4/libexec/lib/python3.13/site-packages/mycli/sqlexecute.py", line 230, in connect
    conn = pymysql.connect(
        database=db,
    ...<14 lines>...
        init_command=init_command or None,
    )  # type: ignore[misc]
  File "/usr/local/Cellar/mycli/1.38.4/libexec/lib/python3.13/site-packages/pymysql/connections.py", line 365, in __init__
    self.connect()
    ~~~~~~~~~~~~^^
  File "/usr/local/Cellar/mycli/1.38.4/libexec/lib/python3.13/site-packages/pymysql/connections.py", line 681, in connect
    self._request_authentication()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/Cellar/mycli/1.38.4/libexec/lib/python3.13/site-packages/pymysql/connections.py", line 958, in _request_authentication
    auth_packet = self._read_packet()
  File "/usr/local/Cellar/mycli/1.38.4/libexec/lib/python3.13/site-packages/pymysql/connections.py", line 782, in _read_packet
    packet.raise_for_error()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/Cellar/mycli/1.38.4/libexec/lib/python3.13/site-packages/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/Cellar/mycli/1.38.4/libexec/lib/python3.13/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1045, "Access denied for user \'<redacted>\'@\'cloudsqlproxy~<redacted-IP>\' (using password: NO)")

Which then re-raises to a 2013 OperationalError and drops the connection.

Any advice on the cause and possible solutions here would be appreciated.

Edited to add: Local socket connections with mycli still work fine, to be clear, as does using the regular old mysql client to connect to the Cloud SQL instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions