当前位置:   article > 正文

ERROR 1142 (42000): GRANT command denied to user ** 或 ERROR 1045 (28000): Access denied for user ‘**_sql 错误 [1142] [42000]: create command denied to us

sql 错误 [1142] [42000]: create command denied to user

★ 两个错误信息:都可能是权限不够的原因,当然第二个问题也有可能是密码输错了。

一、ERROR 1142 (42000): GRANT command denied to user **

错误产生背景:

在cmd控制台,选择某个用户shan,进入mysql服务:
输入命令:grant all on mysqldemo.t_student to shan@localhost;
■ 结果报错:ERROR 1142 (42000): SELECT, GRANT command denied to user 'shan'@'localhost' for table 't_student'


然后输入命令:`grant all on mysqldemo.t_student to shan@localhost identitied by '密码' with grant option;`

■ 结果报错:ERROR 1142 (42000): GRANT command denied to user 'shan'@'localhost' for table 't_student'

解决:在cmd控制台,选择用户root进入即可。

二、 ERROR 1045 (28000): Access denied for user '**'@'localhost' (using password: YES)

1、考虑是不是密码输错了---实在密码想不起来,那就重装一下mysql,mysql是没有找回密码的服务。
2、权限不够


 

总结:在cmd进入mysql进行一些权限分配时候,要注意用root用户进入哈~

看到错误信息“denied--不能” 可能是权限不够。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/625072
推荐阅读
相关标签
  

闽ICP备14008679号