0

I need to setup a MariadB server where I would like the user who will administer the server on a day-to-day basis to have pretty much the ability to do anything - except touch the mysql database, directly manipulate the users table etc. Here is what I have tried

grant all privileges on *.* to myDB@localhost;
revoke super on *.* from myDB@localhost;
revoke all privileges,grant option on mysql.* from mydB@localhost;
show grants for myDB@localhost

For the revoke all I have attempted to follow the instructions in the MySQL docs. However, I get the following error

Error in query (1064): Syntax error near 'on mysql.* from mydB@localhost' at line 1

The other commands do as expected. If it needs saying - I am not much of a SQL expert. I just get their in the end by dint of trial and error. I would be most grateful to anybody who can tell me what I am doing wrong here.

DroidOS
  • 8,530
  • 16
  • 99
  • 171

2 Answers2

0

You have typo in:

grant option on mysql.* from mydB@localhost

It should be:

grant option on mysql.* to mydB@localhost

p.s. remember: GRANT ON TO, REVOKE ON FROM.

Alex Pliutau
  • 21,392
  • 27
  • 113
  • 143
0

You are using from statement for the grant option..The statement must be used with grant is on.

The code will look like

grant option on mysql.* on mydB@localhost

Please see here for more examples

Community
  • 1
  • 1
Avinash Babu
  • 6,171
  • 3
  • 21
  • 26