0
votes

Following the documentation to configure external master replication: https://cloud.google.com/sql/docs/mysql/replication/configure-external-master

I have created a First Generation read replica that is replicating from an external master. But I cannot connect to the Cloud SQL read replica. The documentation states you need to create a user account on the read replica. Attempting to do this gives you Operation not allowed for a read replica. And I see a root and (anonymous) user already but I cannot change their passwords. I get the same error message Operation not allowed for a read replica.

See this screenshot:

enter image description here

2
Can you tell me where you found that The documentation states you need to create a user account on the read replica?Victor M Herasme Perez
Yeah it doesn't say that, but how else do you connect to the read replica? As you can see in the screenshot. There's (anonymous) and root users that are authorized from localhost. If you need to create users on the external master to propagate down to the read replica, I think there should be more clear messaging. That sounds like a security limitation. What if you don't want users connecting to both the master and read replica?Justin Naldzin
You should connect to the read replica with the user and password created in the Master external instance. I agree that maybe the message should be clearer.Victor M Herasme Perez

2 Answers

1
votes

I was able to connect to cloud SQL replica by using 'root' user with no password. In the documentation they suggest you can add users to a replica, but if you try server gives you an error. You can add password to your root user though

0
votes

You should follow the docs regarding External Master configuration. Especially in:

Before you begin

  • ...
  • You must have the external IP address and port of the external master instance, and the username and password information for the replication user on the master instance.
  • ...

Also in Requirements and Tips for Configuring Replication:

  • The MySQL settings of the master instance are propagated to the replica, including root password and changes to the user table.
  • ......

To summarise, the user and password must be set in the Replication master and use those to connect to the read replica.