I have created mysql instance v-8.4 in gcp with ssl. But it is not able to connect to app engine. When I connect to mysql using command line in google cloud shell, after that it connects with app engine as well. But as soon as I restart instance, it fails to connect again. I even tried disabling ssl, but it doesnt help and same issue occurs.
2
Answers
Most likely it points to a configuration issue in your SSL setup or connection handling. The use of Cloud SQL Auth Proxy is the recommended way to securely connect App Engine to Cloud SQL.
Add Cloud SQL Auth Proxy to your App Engine Deployment, in your app.yaml add this code:
Replace the host with the proxy’s Unix socket:
Hope this works!
There is currently an issue that causes logins to fail when you use the Cloud SQL Auth Proxy to connect to MySQL 8.4 with the
caching_sha2_plugin
authentication plugin enabled.We are working on a fix. You can track our progress on the issue here: https://github.com/GoogleCloudPlatform/cloud-sql-proxy/issues/2317
In the mean time, you may work around the issue by configuring the MySQL instance to use the
mysql_native_password
authentication.