Setup replication using mysqldump. Restore getting "Access to system schema 'mysql' is rejected."

Hi,
I was trying to sync a standby database using mysqldump.
Dumped using “mysqldump --all-databases --master-data”

Running the restore I hit “ERROR 3552 (HY000) at line 48031: Access to system schema ‘mysql’ is rejected.”

Can i simply remove the “/!40000 DROP DATABASE IF EXISTS mysql/;” ?

Concerned that replication might not work if I remove the drop.

thanks

Yes , this removing this line , can be workaround

Hi @ipcmlr ,

Even though this question is solved by commenting a “drop if exists” but have this consideration.

  • You were trying to trying to sync a standby database using mysqldump from source.
  • So you executed mysqldump --all-databases --master-data.
  • Then you use the sql file thus generated on replica giving you error Access to system schema ‘mysql’ is rejected. ERROR 3552 (HY000) is a specific error code in MySQL that typically indicates an access restriction or permission issue related to system schemas.
  • This hints that the SQL being executed are using user with not-enough-privileges?! Are you using user with limited privileges?
    Thanks,
    K