I'm trying to add privileges for a newly created user in my database (CLI). But i am getting an error, probably because i have a dash in my db name but how do you work around it?
Error:
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 '-acc.* TO 'bivv-acc'@'localhost'' at line 1
The actual command:
GRANT ALL PRIVILEGES ON bivv-acc.* TO 'bivv-acc'@'localhost';
Note: I am in my database, not in the overview of all the databases. Any clues?
Cheers,
Best Answer
Try to escape dash using the backticks like
Check the manual which says: