I am using System.data.odbc to communicate with my MySQL db. When logged, I would need to know whather the user is admin or not, just to know the rights. Is there any way how to retrieve rights of c开发者_运维问答urrently logged user? Thank you!
There's a SHOW command to retrieve the current user's grants:
SHOW GRANTS
If you don't have the SELECT privilege, SHOW GRANTS will throw an error :)
There's also an INFORMATION_SCHEMA table you can select from:
select * from information_schema.user_privileges
精彩评论