出现报错:

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)的更多相关文章

  1. 【转载】重置密码解决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 ...

  2. 重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor

    一般这个错误是由密码错误引起,解决的办法自然就是重置密码. 假设我们使用的是root账户. 1.重置密码的第一步就是跳过MySQL的密码认证过程,方法如下: #vim /etc/my.cnf(注:wi ...

  3. 解决mysql登录报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)问题

    问题描述: 在ubuntu14.04上安装完MYSQL后,MYSQL默认给分配了一个默认密码,但当自己在终端上使用默认密码登录的时候,总会提示一个授权失败的错误. 报错信息:Access denied ...

  4. 重置密码解决MySQL for Linux错误 ERROR 1045 (28000)

    重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor ...

  5. 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)) 修改: # ...

  6. 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 ...

  7. 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 ...

  8. 在Linux下 MySQL错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决办法【很管用】

    一般这个错误是由密码错误引起,解决的办法自然就是重置密码. 假设我们使用的是root账户. 1.重置密码的第一步就是跳过MySQL的密码认证过程,方法如下: #vim /etc/my.cnf(注:wi ...

  9. 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 ...

随机推荐

  1. json对象组按某个字段排序

    JS排序 键值对 var sortBy=function (filed,rev,primer){ rev = (rev) ? -1 : 1; return function (a, b) { a = ...

  2. 【论文速读】Shangbang Long_ECCV2018_TextSnake_A Flexible Representation for Detecting Text of Arbitrary Shapes

    Shangbang Long_ECCV2018_TextSnake_A Flexible Representation for Detecting Text of Arbitrary Shapes 作 ...

  3. No module named 'pip._internal'

    报错: Traceback (most recent call last):File "/home/myuser/.local/bin/pip", line 7, in <m ...

  4. RTSP-RTMP-HLS媒体播放管理

    近在跟一些做安防行业同学交流中发现,他们对于外网中播放各类视频流觉得各种设置麻烦的很, 好吧,小小的做了一个解决方案. 这个工具从视频监控管理平台剥离出来, 支持对rtsp, rtmp, hls流的管 ...

  5. 内存泄漏(I)

    Block 解决内存泄漏 使用 weakSelf 进行解决 NSTimer 的内存泄漏与解决方案 内存泄漏

  6. An owner of this repository has limited the ability to open a pull request to users that are collaborators on this repository.

    git 无法发起:pull request,提示:An owner of this repository has limited the ability to open a pull request ...

  7. 51nod 1009 数字1的数量(数位dp模板)

    给定一个十进制正整数N,写下从1开始,到N的所有正数,计算出其中出现所有1的个数. 例如:n = 12,包含了5个1.1,10,12共包含3个1,11包含2个1,总共5个1.   数位dp的模板题   ...

  8. 单点登录系统和CAS的简介

    ---恢复内容开始--- 什么是单点登录? 单点登录(Single Sign On),简称为SSO,是目前比较流行的企业业务整合的解决方案之一.SSO的定义是在多个应用系统中,用户只需要登录一次就可以 ...

  9. 01: kerberos认证原理

    1.1 kerberos认证浅析 1.kerberos定义 1. Kerberos 是一种网络认证协议,其设计目标是通过密钥系统为客户机 / 服务器应用程序提供强大的认证服务. 2. Kerberos ...

  10. 提升node.js中使用redis的性能

    问题初现 某基于node.js开发的业务系统向外提供了一个dubbo服务,提供向第三方缓存查询.设置多项业务数据并聚合操作结果.在QPS达到800时(两台虚拟机,每台机器4Core8G4node进程) ...