SELECT t.TABLE_SCHEMA,
       t.TABLE_NAME,
       privs.GRANTEE,
       privs.PRIVILEGE_TYPE,
       privs.LEVEL
FROM INFORMATION_SCHEMA.TABLES AS t
JOIN ( SELECT NULL AS TABLE_SCHEMA,
              NULL AS TABLE_NAME,
              GRANTEE,
              PRIVILEGE_TYPE,
             'GLOBAL' LEVEL
           FROM INFORMATION_SCHEMA.USER_PRIVILEGES
         UNION
       SELECT TABLE_SCHEMA,
              NULL AS TABLE_NAME,
              GRANTEE,
              PRIVILEGE_TYPE,
              'SCHEMA' LEVEL
           FROM INFORMATION_SCHEMA.SCHEMA_PRIVILEGES
         UNION
       SELECT TABLE_SCHEMA,
              TABLE_NAME,
              GRANTEE,
              PRIVILEGE_TYPE,
              'TABLE' LEVEL
           FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES
       ) privs
    ON (t.TABLE_SCHEMA = privs.TABLE_SCHEMA OR privs.TABLE_SCHEMA IS NULL)
   AND (t.TABLE_NAME = privs.TABLE_NAME OR privs.TABLE_NAME IS NULL)
   AND privs.PRIVILEGE_TYPE IN ('SELECT', 'INSERT', 'UPDATE', 'DELETE', 'ALTER',
                                'DROP', 'INDEX', 'REFERENCES', 'LOCK_TABLES',
                                'TRIGGER', 'GRANT OPTION')
WHERE t.TABLE_SCHEMA NOT IN ('sys', 'mysql','information_schema', 'performance_schema');
