[英]Mysql workbench Error 1044 / 1142: Access / Grant command denied to user ''@'localhost' for
I work on a Mac OSX 10.6.8, and I use Mysql Workbench to learn how to handle databases (I'm a beginner as far as databases go). 我使用Mac OSX 10.6.8,并且使用Mysql Workbench学习如何处理数据库(就数据库而言,我是一个初学者)。 Now, I have created a few users, and I'm trying to toy around with giving these users' rights, and let them interact with each other by granting and revoking each other various rights.
现在,我已经创建了一些用户,并且我在尝试赋予这些用户权利,并通过授予和撤消其他各种权利使他们彼此互动。
I have logged in via the root user and supposedly given all "toy users" their initial rights by using the necessary grant queries (verified via queries using "show grants"), but then I try to log in as the various users. 我已经通过root用户登录,并假定使用必要的授权查询(通过使用“ show Grants”的查询进行了验证)为所有“玩具用户”赋予了其初始权限,但随后我尝试以各种用户身份登录。 Let's say two of these users are named "Sofia" and "Martin", and I want Sofia to give Martin the update- and insert-rights to a table "Book".
假设其中两个用户分别名为“ Sofia”和“ Martin”,我希望Sofia为Martin提供对表“ Book”的更新权和插入权。 Sofia was given the necessary privileges from my root-login unless I am mistaken, so I write (when logged in as Sofia)
除非我没有记错,否则从我的root登录名开始,索非亚都获得了必要的特权,所以我写(以索非亚身份登录时)
grant update, insert on Book to Martin;
This yields the error 这产生了错误
Error 1142: GRANT command denied to user ''@'localhost' for table 'book'
错误1142:表'book'的用户'@'localhost'被拒绝使用GRANT命令
Further, I try to figure out what rights Sofia does have, and enter the following query 此外,我试图找出什么样的权利索非亚确实有,并输入以下查询
show grants for Sofia;
when logged in as Sofia. 以索非亚身份登录时。 The response:
响应:
Error 1044: Access denied to user ''@'localhost' for database 'mysql'
错误1044:对用户'@'localhost'的数据库'mysql'访问被拒绝
What is this mysterious ''@'localhost' user the errors are talking about? 错误正在谈论的这个神秘的“ @'localhost”用户是什么? What should I do to make things work?
我应该怎么做才能使事情正常?
grant update, insert on Book.* to `Martin`@`%`;
please click edit to see the back-ticks 请单击“编辑”以查看反向提示
See the MySQL manual page on SHOW GRANTS
请参阅
SHOW GRANTS
上的MySQL手册页
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.