博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes 解决方案
阅读量:6926 次
发布时间:2019-06-27

本文共 1143 字,大约阅读时间需要 3 分钟。

win7 MySql5.6.17

提示:1045 access denied for user 'root'@'localhost' using password yes

从网上找到的解决方法,以此博客做笔记记录。

 

Windows:

1. 管理员登陆系统,停止服务或者结束mysqld-nt进程
2. 进入命令行,来到mysql的安装目录.假设安装目录为 d:\mysql\ , CMD进入命令行
3. 运行 d:\mysql\bin\mysqld-nt --skip-grant-tables 启动mysql,关闭权限的检查
4. 运行 d:\mysql\bin\mysqladmin -u root flush-privileges password "newpassword" 重设root密码
5. 重新启动mysql服务, net stop mysql 接着net start mysql,然后mysql -u root -p 输入密码即可登录

这个验证成功,mysql运行重新正常

 

系统

方法一: 
# /etc/init.d/mysql stop 
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking & 
# mysql -u root mysql 
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’; 
mysql> FLUSH PRIVILEGES; 
mysql> quit 
# /etc/init.d/mysql restart 
# mysql -uroot -p 
Enter password: <输入新设的密码newpassword> 
mysql> 
方法二: 
直接使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码: 
# mysql -udebian-sys-maint -p 
Enter password: <输入[client]节的密码> 
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’; 
mysql> FLUSH PRIVILEGES; 
mysql> quit 
# mysql -uroot -p 
Enter password: <输入新设的密码newpassword> 
mysql> 

分类: 
本文转自左正博客园博客,原文链接:http://www.cnblogs.com/soundcode/p/6132916.html
,如需转载请自行联系原作者
你可能感兴趣的文章
C# winform DataGridView 常见属性
查看>>
读书是为了什么?
查看>>
DICOM-RT:放疗领域中的各种影像
查看>>
C# 线程同步
查看>>
深度学习及机器学习框架对比摘要
查看>>
【转】Oracle 自定义函数语法与实例
查看>>
013-提升状态
查看>>
Office 2016 安装你所必须要注意的事项
查看>>
MonolithFirst
查看>>
java.lang.IllegalArgumentException: Request header is too large 解决方案
查看>>
Word在转PDF的过程中如何创建标签快速方便阅读(图文详解)
查看>>
python字符串(string)方法整理
查看>>
amazeui时间组件测试
查看>>
《数据科学家访谈录》读书笔记
查看>>
jsp 获取服务器ip 以及端口号
查看>>
使用 Laravel-Excel 进行 CSV/EXCEL 文件读写
查看>>
[Vue-rx] Disable Buttons While Data is Loading with RxJS and Vue.js
查看>>
整合使用持久层框架mybatis 使用SqlSessionTemplate模板类与使用映射接口 对比
查看>>
Service Mesh服务网格:是什么和为什么
查看>>
ASP.NET Aries 高级开发教程:Excel导入之代码编写(番外篇)
查看>>