Tip corto: Error en mysql al dar privilegios a bases de datos con nombres númericos

by Jorge Machin on November 21, 2008 · 0 comments

in Tip corto

Si al ejecutar el comando:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON 00.*
TO 'user'@'localhost' IDENTIFIED BY 'password';

obtienes:


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 '00.* TO 'usuario'@'localhost' IDENTIFIED BY 'password'' at line 1

Es porque se necesita usar comillas invertidas en el nombre de la base de datos:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `00`.*
TO 'user'@'localhost' IDENTIFIED BY 'password';

Leave a Comment

Previous post:

Next post: