[英]Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' on Google App Engine
I'm trying to connect to Google Cloud MySQL from Google App engine but getting OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)") 我正在尝试从Google App引擎连接到Google Cloud MySQL,但遇到OperationalError:(2002,“无法通过套接字'/var/run/mysqld/mysqld.sock'(2)连接到本地MySQL服务器”)
I've tried using following settings: 我尝试使用以下设置:
app.yaml: app.yaml:
runtime: python37
env: standard
handlers:
- url: /static
static_dir: static
runtime_config:
python_version: 3
db connection string: mysql+pymysql://{user}:{password}@localhost/{db}?unix_socket=/cloudsql/{conn_name}
数据库连接字符串:
mysql+pymysql://{user}:{password}@localhost/{db}?unix_socket=/cloudsql/{conn_name}
My concern is it was working before but when I changed the db user/password it started giving me above error and reverting my last change did not solved my problem. 我担心的是它在以前工作过,但是当我更改数据库用户/密码时,它开始给我上述错误,并且还原我的上一次更改并不能解决我的问题。 Is there some issue with my settings or could it be some cache issue on app engine?
我的设置是否有问题,或者App Engine上的缓存有问题?
您可以在此处的 Google文档中找到从App Engine标准环境连接到Google Cloud SQL实例的最佳方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.