Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I followed 78246
When I do

mysql> GRANT ALL PRIVILEGES ON *.* for 'root'@'%' IDENTIFIED BY 'password';  
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 'for 'root'@'%' IDENTIFIED BY 'password'' at line 1

How do I make it work ?

share|improve this question
up vote 2 down vote accepted

It should be to, not for.

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password'; 
share|improve this answer
+1, I hate when I've got an answer typed in and I get the "Load new answers?" box right as I'm about to post. – Chris S Jul 8 '10 at 12:47
I thought someone was going to beat me to answering this one :) – theotherreceive Jul 8 '10 at 12:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.