0

I created a new user called Hamza in localhost then I tried to give it these 2 privileges:

  • CREATE USER
  • GRANT

For the creation everything is OK, but when it comes to granting the privileges I tried this query :

GRANT CREATE USER TO 'Hamza'@'localhost' WITH GRANT OPTION;

And I got this error :

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 'TO 'Hamza'@'localhost' WITH GRANT OPTION' at line 1

Could someone tell me how can I correct this syntax error ?

1 Answer 1

1

You are missing the ON object_name here in your GRANT statement like

GRANT CREATE USER ON *.* TO 'Hamza'@'localhost' WITH GRANT OPTION;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.