I am trying to create a MySQL replica in Cloud SQL, Google's managed MySQL service. However I have the following error which won't allow me to start replication:
"kind": "sql#externalSyncSettingErrorList",
"errors": [
{
"kind": "sql#externalSyncSettingError",
"type": "UNSUPPORTED_DEFINER",
"detail": "Definer user root@localhost not supported. Please update host to '%'."
}
]
The docs suggest this as the solution:
Update the definer in the external databases, for example from root@localhost to root@%
I am quite new to MySQL and I don't know how to make this change. I have done some research and it seems definers are related to some action like view
, event
, or routine
so I suppose the question becomes which actions do I need to update the definer for to enable replication?
I found the following snippet which I guess is something like what I will need:
foreach view, event, trigger, routine as object
foreach object with definer=old_user
ALTER object DEFINER=new_user
Thanks in advance.