I was making a SQL file on MySQL as part of a school asignement and I think I got everyting right but a part where it specifies my to create an user an then revoke all permission from him
All sources I have found use something like
CREATE USER IF NOT EXISTS user; REVOKE ALL ON *.* FROM user;
or
CREATE USER IF NOT EXISTS user; REVOKE ALL ON *.* TO USER user;
But both return a systax error in the "FROM/TO" saying that a EOF is expected and I don't even know what is that; am I doing something wrong here?
Should I refer to something first, separate the code sentence or what am I missing?
Seems like a pretty easy task to do and the rest of the code is working, but that error is driving me crazy
CodePudding user response:
This syntax drops all global, database, table, column, and routine privileges for the named users or roles:
REVOKE ALL PRIVILEGES, GRANT OPTION
FROM user;