I am trying to connect to Cloud SQL from a Python application (using PyMySQL 0.7.9) running on top of the Google App Engine.
My connection string looks like this (credentials are fake, of course):
pymysql.connect(unix_socket='/cloudsql/gae_project_name:cloudsql_instance_name',
user='user', password='', db='database_name')
The error message I get is:
OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ([Errno 97] Address family not supported by protocol)")
This is similar to PyMySQL, not recognizing that I am trying to connect via a Unix socket and instead set the default value for the host argument (which I assume localhost)
I can connect to MySQLdb with the same connection string.
source
share