0
mysql> GRANT, SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX,
-> ALTER, CREATE TEMPORARY TABLES, LOCK TABLES
-> ON dbname.*
-> TO 'user'@'localhost'
-> IDENTIFIED BY 'pass';

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 ' SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TA' at line 1

Been having this error on and off constantly lately and have no idea why.

cea
  • 289
  • 3
  • 11

2 Answers2

-1

No comma after GRANT:

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX,
-> ALTER, CREATE TEMPORARY TABLES, LOCK TABLES
-> ON dbname.*
-> TO 'user'@'localhost'
-> IDENTIFIED BY 'pass';
Delan Azabani
  • 76,631
  • 25
  • 162
  • 208
-1

Try this by removing the comma , after the GRANT:-

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX,
-> ALTER, CREATE TEMPORARY TABLES, LOCK TABLES
-> ON dbname.*
-> TO 'user'@'localhost'
-> IDENTIFIED BY 'pass';
Rahul Tripathi
  • 161,154
  • 30
  • 262
  • 319
  • 1
    thanks fixed it but won't let me accept your answer for 8 minutes WTF – cea Oct 27 '13 at 05:44
  • @CharlieBunt:- You are welcome. Not an issue, this is a feature of SO!(And thats really cool). You can accept it after the system allows you to do so :) – Rahul Tripathi Oct 27 '13 at 05:45