重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
出现报错:
Warning: World-writable config file '/etc/my.cnf' is ignored // 该文件权限过高
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)// 密码错误
解决方法:
. chmod 644 /etc/my.cnf // 修改/etc/my.cnf权限
2. grep 'password' /var/log/mysqld.log |head -n 1 // 找临时密码,如果找不到请看3
3. 3如果不行请看4
.删除原来安装过的mysql残留的数据(这一步非常重要,问题就出在这)
rm -rf /var/lib/mysql
.重启mysqld服务
systemctl restart mysqld
.再去找临时密码
grep 'temporary password' /var/log/mysqld.log
4. #重置密码
(1) 在[mysqld]后面任意一行添加“skip-grant-tables”用来跳过密码验证的过程,保存文档并退出 //vim /etc/my.cnf
(2) 重启mysql // service mysql restart
(3)mysql // 免密登陆 (4)use mysql;
update mysql.user set authentication_string=password('你的新密码') where user='root'; // 注意password()是个函数,负责加密密码,不要删除
flush privileges;
(5)删除/etc/my.cnf中的skip-grant-tables
(6)重启mysql服务
重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)的更多相关文章
- 【转载】重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor ...
- 重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor
一般这个错误是由密码错误引起,解决的办法自然就是重置密码. 假设我们使用的是root账户. 1.重置密码的第一步就是跳过MySQL的密码认证过程,方法如下: #vim /etc/my.cnf(注:wi ...
- 解决mysql登录报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)问题
问题描述: 在ubuntu14.04上安装完MYSQL后,MYSQL默认给分配了一个默认密码,但当自己在终端上使用默认密码登录的时候,总会提示一个授权失败的错误. 报错信息:Access denied ...
- 重置密码解决MySQL for Linux错误 ERROR 1045 (28000)
重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor ...
- mysql 链接失败(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES))
mysql链接失败(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)) 修改: # ...
- Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
案例环境: 操作系统 :Red Hat Enterprise Linux Server release 5.7 (Tikanga) 64 bit 数据库版本 : Mysql 5.6.19 64 bit ...
- Ubuntu下MySQL报错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
在Ubuntu下 想要登录mysql数据库 root@JD:~# mysql -uroot -p 报错 ERROR 1045 (28000): Access denied for user 'root ...
- 在Linux下 MySQL错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决办法【很管用】
一般这个错误是由密码错误引起,解决的办法自然就是重置密码. 假设我们使用的是root账户. 1.重置密码的第一步就是跳过MySQL的密码认证过程,方法如下: #vim /etc/my.cnf(注:wi ...
- MAC使用mysql报错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
遇到这种错误,需要重置密码. Step1:停止mysql,命令如下: $ sudo service mysql stop 或者是 $ sudo /usr/local/mysql/support-fil ...
随机推荐
- NOIP2018总结
细细想来,学习OI也有4年多的时间了,今年已经是第二次参加noip提高组了,有必要写点什么了 NOIP2018 记得在天刚蒙蒙亮的时候走进70中,这是第四次了,但紧张只增不减,在刺骨的寒风下身体微微发 ...
- sitecore 获取item的URL
给出一个简单的sitecore项: Item item; 该项目本身不包含它的网址.要获取项目的URL,您需要调用static类Sitecore.Links.LinkManager string ur ...
- LR12集合点设置和多个负载生成器策略
今天给大家分享几个有关LR12的Controller使用过程中的几个常用问题: 一,脚本中添加集合点函数---lr_rendezvous 1,在被测接口事物函数之前加入集合点函数--lr_rendez ...
- sql sugar
事务 using (var db = new SqlSugarClient(new ConnectionConfig() { ConnectionString = Config.xxx, DbType ...
- python __str__() 和 __repr__()是干啥的
1. 没定义__str__() print的时候得不到自己想要的东西 类默认转化的字符串基本没有我们想要的一些东西,仅仅包含了类的名称以及实例的 ID (理解为 Python 对象的内存地址即可).虽 ...
- Linux防火墙iptables基础详解
原文来自于:https://www.linuxidc.com/Linux/2017-01/140073.htm(引用自) 一:前言 防火墙,其实说白了讲,就是用于实现Linux下访问控制的功能的,它分 ...
- 获取手机当前显示的ViewController
//获取手机当前显示的ViewController - (UIViewController*)currentViewController{ UIViewController* vc = [UIAppl ...
- image management in kubernet
Image How can I edit an existing docker image metadata? docker-copyedit Registry Disk kubevirtis a g ...
- Java序列化,解决字段为null与序列化后首字母变小写问题
fastjson.jar package com.apt.utils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.se ...
- JAVA监听器Listener
JAVA监听器Listener 一. 简介 监听器用于对web中内置对象的状态或者属性变化进行监听并做出相应响应的一种Servlet;在内置对象的生命周期中,产生.销毁等状态发生变化时,监听器就会进行 ...