Verify User Privileges

Verify User Privileges

am 27.05.2010 18:07:19 von Carlos Williams

I would like to know how I can verify what privileges have been
granted to a specific user on MySQL. I don't remember if my user
'carlos' has specific privileges on 'mydb' database. I am sure I could
simply re-run the following command:

GRANT ALL PRIVILEGES ON mydb.* TO 'carlos'@'localhost'
-> WITH GRANT OPTION;

I really would like to avoid redundant commands if I could verify that
my user 'carlos' already has the neccessary privileges on the specific
database(s) in question.

Thanks for any info / help!

-Carlos

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Verify User Privileges

am 27.05.2010 18:30:09 von Carlos Williams

On Thu, May 27, 2010 at 12:26 PM, win.a wrote:
> Maybe phpmyadmin is a choice

No I am only allowed to have MySQL installed. No GUI for DBA. I am
sure there is a way to verify the privileges via CLI, I just can't
locate it on the site / documentation.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

RE: Verify User Privileges

am 27.05.2010 18:39:17 von Rolando Edwards

U0hPVyBHUkFOVFMgRk9SICdjYXJsb3MnQCdsb2NhbGhvc3QnOw0KDQpSb2xh bmRvIEEuIEVkd2Fy
ZHMNCk15U1FMIERCQSAoQ01EQkEpDQoNCjE1NSBBdmVudWUgb2YgdGhlIEFt ZXJpY2FzLCBGaWZ0
aCBGbG9vcg0KTmV3IFlvcmssIE5ZIDEwMDEzDQoyMTItNjI1LTUzMDcgKFdv cmspDQoyMDEtNjYw
LTMyMjEgKENlbGwpDQpBSU0gJiBTa3lwZSA6IFJvbGFuZG9Mb2dpY1dvcngN CnJlZHdhcmRzQGxv
Z2ljd29ya3MubmV0DQpodHRwOi8vd3d3LmxpbmtlZGluLmNvbS9pbi9yb2xh bmRvZWR3YXJkcw0K
DQoNCi0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQpGcm9tOiBDYXJsb3Mg TWV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XNxbC5jb20vbXlz cWw/dW5zdWI9cmVk
d2FyZHNAbG9naWN3b3Jrcy5uZXQNCg0K

Re: Verify User Privileges

am 27.05.2010 18:41:21 von Maurice

--001485f6270c838ddb0487960f5b
Content-Type: text/plain; charset=UTF-8

On Thu, May 27, 2010 at 7:30 PM, Carlos Mennens wrote:

> On Thu, May 27, 2010 at 12:26 PM, win.a wrote:
> > Maybe phpmyadmin is a choice
>
> No I am only allowed to have MySQL installed. No GUI for DBA. I am
> sure there is a way to verify the privileges via CLI, I just can't
> locate it on the site / documentation.
>
>

#1
select host,user from mysql.user;

#2
show grants for USER@HOST;

--
Maurice

--001485f6270c838ddb0487960f5b--

RE: Verify User Privileges

am 27.05.2010 19:15:22 von Rolando Edwards

SWYgeW91IGRvIG5vdCBoYXZlIGNlcnRhaW4gcmlnaHRzLCB0aGVuIGp1c3Qg ZG8NCg0KU0hPVyBH
UkFOVFM7DQoNClJvbGFuZG8gQS4gRWR3YXJkcw0KTXlTUUwgREJBIChDTURC QSkNCg0KMTU1IEF2
ZW51ZSBvZiB0aGUgQW1lcmljYXMsIEZpZnRoIEZsb29yDQpOZXcgWW9yaywg TlkgMTAwMTMNCjIx
Mi02MjUtNTMwNyAoV29yaykNCjIwMS02NjAtMzIyMSAoQ2VsbCkNCkFJTSAm IFNreXBlIDogUm9s
YW5kb0xvZ2ljV29yeA0KcmVkd2FyZHNAbG9naWN3b3Jrcy5uZXQNCmh0dHA6 Ly93d3cubGlua2Vk
aW4uY29tL2luL3JvbGFuZG9lZHdhcmRzDQoNCg0KLS0tLS1PcmlnaW5hbCBN ZXNzYWdlLS0tLS0N
CkZyb206IFJvbGFuZG8gRWR3YXJkcyBbbWFpbHRvOnJlZHdhcmRzQGxvZ2lj d29ya3MubmV0XSAN
ClNlbnQ6IFRodXJzZGF5LCBNYXkgMjcsIDIwMTAgMTI6MzkgUE0NClRvOiBD YXJsb3MgTWVubmVu
czsgTXlTUUwNClN1YmplY3Q6IFJFOiBWZXJpZnkgV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