I got the "triggers cannot be created on system tables" error while running my trigger and looked online on how to fix this and one solution was to grant the user privileges to the schema. Now I am doing that but mysql is saying that I have a syntax error on line 1 near 'localhost'.This is my query and Im basing this off of the MySQL website. Can somebody tell me what wrong so I can run my trigger?
CREATE USER 'root' @ 'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON mysql.* TO 'root' @ 'localhost';