简体   繁体   中英

how to grant select only rows to user mysql using command line?

How am I able to grant a mysql user to only select rows in command line ie GRANT SELECT X TO USER BOB ?

Have checked on https://dev.mysql.com/doc/refman/5.7/en/grant.html , http://www.stackoverflow.com and others.

I have researched and there seems to be no conclusive answer.

I know it's a one-liner but after all I have tried, no dice.

You should use the for all the table or

  GRANT SELECT ON your_db_name.* TO ''bob'@'%';

for a single table

  GRANT SELECT ON your_db_name.yor_table_name TO ''bob'@'%';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM