Trying to create a limited backup user by running this command
GRANT SELECT, RELOAD, FILE, SUPER, LOCK TABLES, SHOW VIEW ON 'db_prod'.* TO 'backup'@'localhost' IDENTIFIED BY 'password';
I get error
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''db_prod'.* TO 'backup'@'localhost' IDENTIFIED BY 'password' at line 1
I don't understand why
CodePudding user response:
You can't use single quotes around the database name, as this must be a database object and not a string
so write them with out single quotes or use backticks
GRANT SELECT, RELOAD, FILE, SUPER, LOCK TABLES, SHOW VIEW ON `db_prod`.* TO 'backup'@'localhost' IDENTIFIED BY 'password';