Page 1 of 1
MySQL Permissions
Posted: Sat Sep 16, 2006 5:00 pm
by Todd_Z
Code: Select all
grant select (field,id), update (field) on db.table to user@localhost;
I thought that this would give read permission on field and id for user on the database db, also with update privilege to field.
However, when I login as user@localhost, and do a select * from db.table, it shows the whole table's data.
Any ideas?
Posted: Sat Sep 16, 2006 8:58 pm
by feyd
That I remember, the restrictions only go to the table level of granularity. If you need more, break them into separate tables.

Posted: Sat Sep 16, 2006 11:09 pm
by RobertGonzalez
You can assign permissions to a field level. I have absolutely no clue what the SQL is for that, but I know it can be done. Maybe do it in PMA or SQLYog an see what the resultant SQL is.
Posted: Sun Sep 17, 2006 3:11 am
by volka
However, when I login as user@localhost, and do a select * from db.table, it shows the whole table's data.
Does
SELECT User() confirm you're using the right account?
With an account with sufficient privileges try
SHOW GRANTS FOR 'user'@'localhost'. What does it return?