Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'SHOW command denied to user' when setting up user permissions

Tags:

mysql

I need to grant a user UPDATE and SELECT to two specific column in a db using MYSQL

I used the below command to do this

GRANT SELECT (title,new_title,catagory,description,runtime), UPDATE    (title,new_title,catagory,description,runtime) ON database.table1 TO 'user1'@'%' IDENTIFIED  BY    'xxx';
FLUSH PRIVILEGES

However when I try to view the table/fields using Sequal Pro I get the following error

MySQL said: SHOW command denied to user 'suer1'@'host.x.x.x' for table 'table1'

I can see the DB in the database list along with the one table I have granted access to, but I can't read any of the data from it.. Would anyone know how I can fix this error and only view/edit the tables/column I want..?

like image 333
Jim Avatar asked Nov 25 '25 20:11

Jim


1 Answers

Your grant will actually work, if you select the specific columns in question:

SELECT title, new_title, catagory, description, runtime FROM table1

However, a more general query like this will fail with SELECT command denied to user:

SELECT * FROM table1

I believe this may be an issue with the way Sequal Pro tries to get information about the table. It says MySQL said: SHOW command denied to user, but despite that the following works:

SHOW COLUMNS FROM table;

I'm not sure which SHOW command is failing for Sequal Pro.

like image 54
Luke Avatar answered Nov 27 '25 09:11

Luke



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!