How can I list all users in my MariaDB?
Teh Internet is full of
SELECT user FROM mysql.user;
in all its variations, but this does not work on MariaDB (I'm on version 10.5.19 if that matters), rather it produces the error (run with root privileges):
ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
I found only one single comment that is vaguely helpful: https://stackoverflow.com/a/64841540
MariaDB-10.4+ the
mysql.useris a view rather than a table.[…] Always check the official documentation.
Point is, I did check the official documentation, but it appears to silently assume that you already know your user names. I did not find any mention of how to get these in the first place, i. e. how to just display a list of users.
SELECT User FROM mysql.user;? – Romeo Ninov Jun 11 '23 at 15:45mysql -u rootthen in mysql:use mysql; show tables;– Romeo Ninov Jun 11 '23 at 17:36