I'm trying to connect to Cloud SQL from a Python application (using PyMySQL 0.7.9) running on top of 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 receive is:
OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ([Errno 97] Address family not supported by protocol)")
It's like PyMySQL doesn't recognize that I'm trying to connect through a Unix socket and tries the default value for the host argument instead (which I presume is localhost
)
I am able to connect with MySQLdb with the same connection string.