error: The MySQL server is running with the --read-only option so it cannot execute this statement

169 views
Skip to first unread message

Dan Ostrosky

unread,
Apr 26, 2020, 1:39:09 PM4/26/20
to Google Cloud SQL discuss
Hi, I have an issue with GCP Mysql. I have one master instance with 1 read replica. sometimes when there is maintenance operation on the server some write queries are routed to the read replica instance and therefore I get the following error: The MySQL server is running with the --read-only option so it cannot execute this statement. How should I handle this situation? thx

Aref Amiri (Cloud Platform Support)

unread,
Apr 27, 2020, 3:16:21 PM4/27/20
to Google Cloud SQL discuss
Hi,

You might want to consider using High Availability configuration, as this will ensure that all writes made to the primary instance are also made to the standby instance. This option will reduce downtime and your data continues to be available to client applications during maintenance time.

Another option to minimize the impact of downtime would be to set a Preferred Maintenance Window, as it will allow you to set a specific time and day to control the timing of maintenance.
Reply all
Reply to author
Forward
0 new messages