简体   繁体   English

如何使用命令行向用户mysql只授予选择行的权限?

[英]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 ? 我如何才能授予mysql用户仅在命令行中选择行的权限,即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. 已检查的https://dev.mysql.com/doc/refman/5.7/en/grant.htmlhttp://www.stackoverflow.com等。

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'@'%';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MySQL的:授予用户拒绝命令 - mysql: grant command denied for user 如何授予所有使用mysql服务器的用户 - how to grant all user using mysql server 使用MySQL命令行,如何在Select语句中仅显示日期或金额(十进制)列? - Using the MySQL command line, how can I display only date or amount (Decimal) columns in a Select statement? ***如何在 MySQL 中使用外键约束仅选择特定行? - ***How to select only perticular rows using Foreign Key constraint in MySQL? 使用命令行更改mysql用户密码 - Change mysql user password using command line 如何使用 mysql 在谷歌云中授予用户权限? - How to grant user privileges in google cloud using mysql? 如何在MySQL命令行客户端中更改用户 - How to change user in MySQL Command Line Client 如何只为每个用户选择最新的行? - How to select only the latest rows for each user? 我想使用“授予选项”命令将确切的特权分配给一个用户,以便在MYSQL中将另一个用户分配给另一个用户 - using the “grant options” command i want to assign the exact privileges as one user to another in MYSQL 如何在 MySQL 中仅向新用户授予少数特权(仅执行 DML 和 DDL 语句)? - How to grant only few previleges ( to execute only DML and DDL statements) to the new user in MySQL?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM