MySQL8.0解决 ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES) 问题

使用的版本是mysql8.0的版本;

出现错误:

 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES);

第一步:关闭  net stop mysql   这个需要cmd的管理员权限;

第二步:在安装MySQL的bin目录 执行 :mysqld --console --skip-grant-tables --shared-memory

第三步:启动一个新的cmd窗口   执行   mysql -uroot -p    就能免密进入

第四部修改密码:

   1.  use mysql;

   2. update user set authentication_string='' where user='root';      如果这个字段有值,先置为空

   3. flush privileges;     刷新权限表

   4.ALTER user 'root'@'localhost' IDENTIFIED BY '123456';     修改root 密码

就OK了

评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值