没有合适的资源?快使用搜索试试~ 我知道了~
首页linux下 root 登录 MySQL 报错的问题
linux下 root 登录 MySQL 报错的问题
8 下载量 83 浏览量
更新于2023-03-03
评论
收藏 44KB PDF 举报
最近在centOS 7上,通过yum安装了mysql,安装成功后,使用root登录,出现了如下报错: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) mysql版本为:Ver 14.14 Distrib 5.7.10, for Linux(X86_64) using EditLine wrapper 然而实际上并没有进行过root密码设置(不知道是不是安装过程有被忽略的地方?)。 对此就各种寻找答案,大致有下面一些情况: 有说root的随机密码位于/root/.mysql_
资源详情
资源评论
资源推荐
linux下下 root 登录登录 MySQL 报错的问题报错的问题
最近在centOS 7上,通过yum安装了mysql,安装成功后,使用root登录,出现了如下报错:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
mysql版本为:Ver 14.14 Distrib 5.7.10, for Linux(X86_64) using EditLine wrapper
然而实际上并没有进行过root密码设置(不知道是不是安装过程有被忽略的地方?)。
对此就各种寻找答案,大致有下面一些情况:
有说root的随机密码位于/root/.mysql_secret中,但是我根本没有/root/.mysql_secret文件。有文章表示
> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
> password: NO) :表示没有生成root的临时密码
>
> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
> password: YES) :表示生成了root的临时密码。
有些资料说root的默认密码为空,经过确认那是以前的老版本,Mysql 5.6及以后版本出处于安全考虑,root密码已经不为空
了。
最终找到对我来说有用的解决方案。
产生原因:
Now that the password MySQL had generated is expired, the problem is reduced to getting this password to work again (1) or generate a new one (2).
This can be accomplished by running MySQL with the skip-grant-tables option which would make it ignore the access rights:
解决方法:
代码如下:
Stop your MySQL server.
Add skip-grant-tables at the end of the [mysqld] section of my.cnf file and save it.
Start MySQL server.
In terminal, typemysql -u root -pto get into MySQL command prompt.
In the command prompt, typeUSE mysql;to get into the mysql database where it keeps database users.
Type
UPDATE user SET password_expired = ‘N’ WHERE User = ‘root’;
to let MySQL know the password is not expired (1) or
UPDATE user SET authentication_string = PASSWORD(‘YourNewPassword’), password_expired = ‘N’ WHERE User =
‘root’;
附上链接:Unable to access MySQL after it automatically generated a temporary password
发布出来,供大家参考。
您可能感兴趣的文章您可能感兴趣的文章:Linux连接mysql报错:Access denied for user ‘root’@‘localhost’(using password: YES)的解决方法Linux
初始化MySQL 数据库报错解决办法linux 环境 mysql写入中文报错linux mount报错:you must specify the filesystem type的解
决方法thinkphp项目部署到Linux服务器上报错“模板不存在”如何解决linux mysql 报错:MYSQL:The server quit without
updating PID fileLinux常见英文报错中文翻译(菜鸟必知)
weixin_38724154
- 粉丝: 7
- 资源: 895
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- zigbee-cluster-library-specification
- JSBSim Reference Manual
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0