Re: [PHP-DB] db privileges

[email protected] (Frank Flynn)
Newsgroups php.db
Message-ID <[email protected]>
On Jan 6, 2009, at 7:41 AM, [email protected] wrote:

>
> I was wondering if there is a php function
> and/or mysql function that can be run from php to find out the  
> privileges
> for a particular db connection.  Any ideas?

Just to get you started try:

    select * from mysql.user where concat(user, '@', host) like  
(select CURRENT_USER())\G

That worked for me, I'm sure you can go join to INFORMATION_SCHEMA and  
do more exotic (more precise) things too.

Good Luck,
Frank
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.