ERROR 1142 (42000): GRANT command denied to user ** 或 ERROR 1045 (28000): Access denied for 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--不能” 可能是权限不够。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Coder-coco

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值