Friday, March 27, 2020

[google-cloud-sql-discuss] Re: Error establishing a database connection

Hi,

Have you tried to connect using a tool such as MySQLWorkBench and test the connection.
Also, check whether or not the the port setting is set to 3306.
Have you also set DB_NAME?

Thanks


On Friday, 27 March 2020 15:21:20 UTC+2, Jun Leong Wong wrote:
Hi,

I have successfully imported my sql into Google Cloud SQL (MySQL).

I migrated the database to Google Cloud SQL but the whole Wordpress files still remain on my own server.

I have edited the wp-config.php as follow:


/** MySQL database username */
define('DB_USER', 'myuser');  // this is the username under master instance > username

/** MySQL database password */
define('DB_PASSWORD', 'mypass');  // this is the password under master instance > username

/** MySQL hostname */
define('DB_HOST', '35.227.86.242'); // under Connect to this instance > Public IP address > 35.227.86.242

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', 'utf8_general_ci');



But it doesn't work.

I got Error establishing a database connection message.

Helps needed.

Thanks.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/30ac5c34-9fd3-4037-b7e3-f2cc307bf79c%40googlegroups.com.

No comments:

Post a Comment