Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

first of all I am following this tutorial.

as they mentioned I am writing my query as:

mysql> grant select
    -> on play.*
    -> to 'guest' @ 'localhost'
    -> IDENTIFIED BY '459459';
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 ''localhost'
IDENTIFIED BY '459459'' at line 3
mysql> 

but I am still getting an error. What is it that I am doing wrong?

share|improve this question
    
The only thing I can see is the spacing -> to 'guest' @ 'localhost' should be -> TO 'guest'@'localhost', but I'm not sure if it really matters about the spacing or not. The main error is that there should be a capital TO & ON PLAY –  SimplySimon Sep 9 '13 at 12:45
    
@SimplySimon as I know the capital words or small words doesnt make difference. –  AgentCool Sep 9 '13 at 12:48
3  
Can you post the first three lines of your file in your question. If these are the first three lines then the error is on the third line. Therefore I suggest -> TO 'guest'@'localhost' –  SimplySimon Sep 9 '13 at 12:51
    
@SimplySimon oh my god you are amazing .... that worked. I have removed the space. please make it as answer. I will accept that. –  AgentCool Sep 9 '13 at 13:40

1 Answer 1

up vote 3 down vote accepted

The answer, looking at the link you gave appears to be either the capitalisation of the key words, TO or the fact that you have placed a space either side of the @ in line 3.

Present:

-> to 'guest' @ 'localhost'

Correct syntax

-> TO 'guest'@'localhost'
share|improve this answer

Your Answer

 
discard

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.