← Back to team overview

maria-discuss team mailing list archive

Does user have SUPER privilege?

 

Hi,

I was wondering if there is a straight forward way to check whether a user has SUPER privileges or not.

I came up with doing the following:

--check for user’s Super_Priv on the current host
SELECT Super_Priv FROM mysql.user WHERE user = 'user1' AND host = 'host1';
--and then also check for user on whatever (%) host:
SELECT Super_Priv FROM mysql.user WHERE user = 'user1' AND host = '%'

But is there some more convenient way of doing it, maybe using SHOW GRANTS?

Rasmus

-- 

Rasmus Johansson, VP Engineering
MariaDB | t: +358 50 499 9589 | Skype: ratzpo

Follow ups