开发者

C# connecting to MySQL -get DB user rights?

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜