• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

grant异常,解释得详细的加分

mysql 搞代码 7年前 (2018-05-31) 188次浏览 已收录 0个评论

grant错误,解释得详细的加分!
没学过数据库,照抄书上的.
mysql>   grant   all   on   depot_development.*   to   'dave '@ 'localhost ';
这个句子是什么意思,为什么会导致出错?
ERROR   1133   (42000):   Can 't   find   any   matching   row   in   the   user   table

上面这个是什么错误?
========
Enter   password:   *********
Welcome   to   the   MySQL   monitor.   Commands   end   with   ;   or   /g.
Your   MySQL   connection   id   is   1   to   server   version:   5.0.27-community-nt

Type   'help; '   or   '/h '   for   help.   Type   '/c '   to   clear   the   buffer.
mysql>   show   databases;
+——————–+
|   Database   |
+——————–+
|   information_schema   |
|   depot_development   |
|   depot_production   |
|   depot_test   |
|   mybook   |
|   mysql   |
|   test   |
+——————–+
7   rows   in   set   (0.00   sec)

mysql>   grant   all   on   depot_development.*   to   'dave '@ 'localhost ';

ERROR   1133   (42000):   Can 't   find   any   matching   row   in   the   user   table

mysql>   grant   all   on   depot_test.*   to   'dave '@ 'localhost ';

ERROR   1133   (42000):   Can 't   find   any   matching   row   in   the   user   table

mysql>   grant   all   on   depot_production.*   to   'prod '@ 'localhost '   identified   by   'wibb
le ';
Query   OK,   0   rows   affected   (0.00   sec)

——解决方案——————–
grant all privileges on depot_development.* to 'dave '@ 'localhost ';
——解决方案——————–
这是Rails敏捷Web开发那本书上的例吧.

你上面没有dave这个用户.

我是用
mysql> grant all on depot_development.* to 'root '@ 'localhost ';
就好了.

然后成功提示
Query OK.0 row affected (0.08sec)

——————————
qifanz┊Gmail.com
——解决方案——————–
grant all privileges(所有权限) on depot_development.*(在depot_development的所有表上) to 'dave '@ 'localhost '(用户)identified by '123456 '(用户密码:123456);


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:grant异常,解释得详细的加分

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址