@ashish.varghese Make sure your database details or credentials is correct on below location /var/www/localhost/htdocs/openemr/sites/default/sqlconf.php
Two things are probably going on, and only one of them is the real problem.
The error in your log hides the real one. “Call to a member function prepare() on false” comes from OpenEMR’s error page itself. When the database connection fails, the page tries to translate its message, which needs the database, and dies. The real failure is the one before it, the one the browser shows as “Check that you can ping the server”.
With SSL, PHP checks the database server’s name. Once mysql-ca is in sites/default/documents/certificates, OpenEMR connects over SSL, and PHP checks two things about the server’s certificate: that mysql-ca signed it, and that it names the host in sqlconf.php. Cloud SQL’s server certificate names the instance, not its internal IP, so connecting by IP fails that check. PHP reports it only as “Cannot connect to MySQL using SSL” (error 2002), which looks like the server isn’t there at all. Adding mysql-cert and mysql-key doesn’t change that check, which is why it made no difference.
What usually works on Cloud Run:
Cloud SQL’s own connection (the Cloud SQL connection on the Cloud Run service, or the Cloud SQL Auth Proxy) encrypts the traffic for you, with no certificates in OpenEMR. Then leave mysql-ca, mysql-cert and mysql-key out of documents/certificates.
Or connect by a name that’s in the server’s certificate rather than the IP. That’s harder to arrange with Cloud SQL.
To see exactly what’s refused, the install doctor reads your site’s settings and the certificates folder, connects the way OpenEMR does, and says whether mysql-ca didn’t sign the server’s certificate or which names the certificate holds instead of your host:
Hi @ashish.varghese ! Great to hear it was solved. Would you mind adding a preffix to the thread title like `[SOLVED] OpemEMR on Cloud Run Instance not able to connect with Cloud SQL Mysql using SSL` ? thanks!
EDIT:
Now a chkbox is available to mark as ‘‘solved’’ next to the thread.