I log into mysql as root and run
GRANT SELECT (`creator`, `name`, `disguise`), SHOW VIEW ON `kit` TO 'ssc'@'localhost';
Now from my code I log in as 'ssc'@'localhost'
.
Connection db = DriverManager.getConnection(..., 'ssc', ...);
How can the user 'ssc'@'localhost'
check that it has the above grant?
I am thinking maybe I can execute some queries in a try
/ catch (SQLException)
block, but perhaps there's a more elegant way.
Also if I am to take that approach I don't know what queries would be the most appropriate (fastest, least intensive).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.