Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error connecting to Google Cloud SQL #3

Open
neilstuartcraig opened this issue Jan 8, 2018 · 0 comments
Open

Error connecting to Google Cloud SQL #3

neilstuartcraig opened this issue Jan 8, 2018 · 0 comments

Comments

@neilstuartcraig
Copy link

neilstuartcraig commented Jan 8, 2018

Hi

I'm trying to use this plugin with Wordpress @latest and am seeing errors connecting to the DB which is an GCP CloudSQL instance.

Connecting via the CLI MySQL client works fine:

mysql -uwp-access -h <db-server-ip> --ssl-ca /etc/ssl/certs/jhs-db-access-ca.crt --ssl-cert /etc/ssl/certs/jhs-db-access.crt --ssl-key /etc/ssl/private/jhs-db-access.key

But connecting with this added to the end of my wp-config.php file fails:

define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);
define('MYSQL_SSL_CERT', "/etc/ssl/certs/jhs-db-access.crt");
define('MYSQL_SSL_KEY', "/etc/ssl/private/jhs-db-access.key");
define('MYSQL_SSL_CA', "/etc/ssl/certs/jhs-db-access-ca.crt");

with error:

2018/01/08 22:19:48 [error] 3545#3545: *3563 FastCGI sent in stderr: "PHP message: PHP Warning:  mysqli_real_connect(): (HY000/1045): Access denied for user 'wp-access'@'<db-server-ip>' (using password: NO) in /var/www/jhs/wp-content/db.php on line 92" while reading response header from upstream, client: <web-server-ip>, server: <hostname>, request: "GET /page/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "<hostname>

The connection works fine when not over TLS and using username/password auth.

Any ideas you can suggest please?

I am a little unsure what i need to set DB_USER and DB_PASSWORD to (null? `''``?).

Any help would be gratefully appreciated :-)

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant