Fine-grained GRANT permissions in MySQL

Fine-grained GRANT permissions in MySQL

Posted by: toffee
Posted on: 2006-05-30 15:34:00

I know you can set permissions for MySQL users in the panel, but they seem to be only global (i.e., to all tables). How do I set permissions by table? For example, I'd like to grant access for a certain user only to one table, something like:

GRANT SELECT ON database.table TO 'user'@'localhost' IDENTIFIED BY 'password';

Thanks a lot.

Re: Fine-grained GRANT permissions in MySQL

Posted by: aixccapt99
Posted on: 2006-05-31 07:54:00

Did you try issuing that SQL from phpMyAdmin, or from a command-line connection to your mysql server? You'd log in as the primary user (who has full GRANT privileges) and then create the limited-access user and use the SQL you describe to grant table-level privileges.

Re: Fine-grained GRANT permissions in MySQL

Posted by: toffee
Posted on: 2006-05-31 15:54:00

I'm in a shared server, so apparently I can't issue GRANT commands from the command-line or phpMyAdmin. Any other way to do it?

Tags: mysqllocalhostpassword thanksdatabase tablegloballotaccessset permissions