Hi Chris/Lists, In fact, I was able to login using both ways, here's what I did. 1. mysql -u testuser -ptestuser -hlocalhost DATABASE >> OK 2. In the mysql prompt, I issue the query 'SELECT * FROM CHECK_SBIN' >> Access denied ** This is were I'm getting the error Access denied for user 'testuser'
Thanks, Richard
That looks correct.
Your requirements are unclear:
In your first attempt, you grant access to the entire table with one GRANT statement, then to just a couple of columns with the second GRANT statement. This gives you access to the entire table (because of the first statement), which apparently is unsatisfactory -- you say you want access granted only for the two columns.
In your second attempt, you grant access only to the two columns. This should, I think, give you what you want -- but then above you issue a SELECT * statement, which implies that you want access to the entire table. But you can't *have* access to the entire table, because you've granted access only to two columns.
So I at least am unable to determine what you really want.
Perhaps you are thinking that SELECT * should retrieve only those columns for which you have access. But that's not what it means. It means ALL columns in the table. To select only the columns for which you have granted access, you must name them explicitly.
The exception would be if the table contains only those two columns. In that case, SELECT * should work. But my impression is that your table has more than just the two columns.
"Chris" <[EMAIL PROTECTED]> 13/11/2003 10:34 AM
To: "Mysql List" <[EMAIL PROTECTED]> cc: (bcc: BORNAY Richard/Engr/STATS/ST Group) Subject: RE: GRANT TO SELECTED COLUMNS
That second query, byt itself, should have done it, were you logged in as testuser when you tried to run it?
Chris
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 12, 2003 5:26 PM To: [EMAIL PROTECTED] Subject: GRANT TO SELECTED COLUMNS
Hello List, I have a table named CHECK_SBIN with fields id,jobid,filename,sbin,count, then I would like to create an account lets say testuser with SELECT privileges only to a specific columns. In this case I would like to open only id and jobid to 'testuser'. I have already created an account to testuser in two ways using the commands below. 1. Provide SELECT privileges first on the CHECK_SBIN table - GRANT SELECT ON DATABASE.CHECK_SBIN TO testuser IDENTIFIED BY 'password' >> OK Then issue another GRANT statement for the specific columns - GRANT SELECT (id, jobid) ON DATABASE.CHECK_SBIN TO testuser >> OK
Comments: I was able to access mysql using the account and seeing only CHECK_SBIN but when I do 'SELECT * FROM CHECK_SBIN' it shows me all the columns in the table.
2. Use only the second SQL - GRANT SELECT (id, jobid) ON DATABASE.CHECK_SBIN TO testuser >> OK
Comments: An error occured 'Access denied for testuser'.
Note: The grant tables are all checked correctly.
System: MySQL 4.0.13 Solaris 8
I checked the manual and mailing list archive and was not successful in finding any related matter to my problem. Any help would be appreciated.
Thanks, Richard
-- Paul DuBois, Senior Technical Writer Madison, Wisconsin, USA MySQL AB, www.mysql.com
Are you MySQL certified? http://www.mysql.com/certification/
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]