简体   繁体   中英

Testing privileges for PHP script's MySQL user

I am making a website that I expect to be hosted on several servers. I want to be able to check to make sure the MySQL user that has been created on those servers has sufficient privileges so that I can give a clear error if one of the privileges that the MySQL user requires is missing.
I found the MySQL command SHOW GRANTS FOR CURRENT_USER but its output looks like it would require a bunch of work to parse.

Is there a better way to verify that the MySQL user has sufficient permissions?

嗨,尝试使用下面的select语句代替SHOW GRANTS。

SELECT * FROM mysql.user WHERE USER LIKE 'root';

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM