0

I'm setting up mysql replication using xtrabackup guide https://docs.percona.com/percona-xtrabackup/innovation-release/set-up-replication.html#2-copy-backed-up-data-to-the-replica

On Master/Source I'm running this command

GRANT REPLICATION SLAVE ON *.* TO 'root'@'12.34.56.78' IDENTIFIED BY 'asdfd34F4fg';

Gives error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY 'asdfd34F4fg'' at line 1

How to fix it?

1
  • What version of database server? Please run SELECT VERSION(); and tell the result. Feb 11 at 13:46

1 Answer 1

0

I suppose you do not want to change the root user's password so remove everything starting from IDENTIFIED.

2
  • The root and password is for replica server. I'm running this query on master/source server to grant permission to replica server.
    – Vaughn
    Feb 11 at 13:01
  • If you are running mysql 8.0 then split the CREATE USER .. IDENTIFIED BY .. with the GRANT statement. The instruction to GRANT .. IDENTIFIED BY .. only works on old MySQL 5.x versions Feb 12 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.