1

I can't find a good answer for the meaning of % used in the sql statement:

REVOKE SELECT ON `%`.* FROM 'db_user'@'%

Is it a wildcard value? So does % in %.* refer to all available schemaIDs and * means all tables available in each schemaID?

When I try:

GRANT INSERT, UPDATE ON `%`.tablename TO 'db_user'@'%';

I get the error:

Error Code: 1146. Table '%.tablename' doesn't exist

Shouldn't it go to the specific schemaID with the tablename and grant the rights and ignore the rest?

Then how about % in 'db_user'@%? Versus 'db_user@localhost'?

Any help is appreciated.

sample

f0rfun
  • 716
  • 4
  • 14
  • 36
  • What is the vendor ? `MySQL` != `SQL Server` ? – ahmed abdelqader Jan 03 '18 at 10:51
  • sorry it's mysql not SQL server. Shadow has removed the error tag. – f0rfun Jan 03 '18 at 10:52
  • @f0rfun You might want to look at https://stackoverflow.com/questions/11321491/when-to-use-single-quotes-double-quotes-and-backticks-in-mysql on how/when to use which quotes style. – Progman Jan 03 '18 at 11:20
  • Starting point: [REVOKE Syntax](https://dev.mysql.com/doc/refman/5.7/en/revoke.html) – Álvaro González Jan 03 '18 at 11:26
  • Yes, I was there. It brings you back to GRANT syntax for priv_type, priv_level, and object_type. It doesn't explain what '%'.* means. I can't find a clear example on the internet after googling but in SQL it's a permissible action as per my screenshot. I want to understand better what it does. – f0rfun Jan 03 '18 at 11:34

0 Answers0