Not Able To Connect App Engine To Cloud Sql For Mysql Instance
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, 'Can't connect to MySQL server on 'localhost' ([Errno 2] No such file or directory)') (Background on this err
Solution 1:
App Engine standard enviroments do not support connecting to the Cloud SQL instance using TCP. Your code should not try to access the instance using an IP address (such as 127.0.0.1 or 172.17.0.1) unless you have configured Serverless VPC Access.
From your question I understand that you are using vpc_access_connector
. Therefore I assume that you configured Serverless VPC Access.
The code used in main.py is for connecting to Cloud SQL instance's using unix domain socket and not TCP.
EDIT:
CONNECTING FROM APP ENGINE TO CLOUD SQL USING TCP AND UNIX DOMAIN SOCKETS
1.Create a new project
gcloud projects create con-ae
Post a Comment for "Not Able To Connect App Engine To Cloud Sql For Mysql Instance"