Re: db privileges
| From: | Patrick Price | Date: | Wed, 07 Jan 2009 00:35:24 +0000 |
| Subject: | Re: db privileges | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-45862@lists.php.net to get a copy of this message | ||
Hey Frank,
I wasn't able to run the query:
select * from mysql.user where concat(user, '@', host) like (select
CURRENT_USER())
because I didn't have privileges to view the table, but I was able to root
around the INFORMATION_SCHEMA table and find what I needed.
thanks!
patrick
On Tue, Jan 6, 2009 at 2:08 PM, Frank Flynn <frank@declan.com> wrote:
>
> On Jan 6, 2009, at 7:41 AM, php-db-digest-help@lists.php.net 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
>