mysql 登录输入密码有时会碰到如题的错误。

错误描述

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

解决方法

# /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' and host='root' or host='localhost';//把空的用户密码都修改成非空的密码就行了。
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysqld restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>

【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. 解决ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)【亲测有效】

    文件转自:https://blog.csdn.net/hua1011161696/article/details/80666025 问题:(MySQL 5.6社区版windows版) 忘记密码或其他一 ...

  3. 【MySQL】ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    问题现象: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问root用户 ...

  4. mysql安装在centos7报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    原文链接:http://blog.csdn.net/kuluzs/article/details/51924086 [问题]:mysql版本:5.7.13 首次在centos下安装MySQL,客户端连 ...

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

  6. MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)的真正原因

    在博客Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N ...

  7. 升级到macOS 10.12 mysqlb报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    系统升级到macOS 10.12后启动mysql后,在终端输入mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' ...

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

  9. 安装mysql因为/tmp权限不足而导致ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)的解决方案

    本机是centos 6.5  安装的mysql是5.1的版本. 在安装mysql之后,第一次启动mysql服务的时候,需要/tmp有777(rwxrwxrwx)的权限,然而楼主的/tmp是755(rw ...

随机推荐

  1. PHP计算上一个月最后一天、当月最后一天、下一个月最后一天

    上个月最后一天: $last_month_last_day = date('Y-m-t',strtotime('-1 month')); 当月最后一天: $first_day=date('Y-m-01 ...

  2. 5-es6的模块化开发与其它的不同

    1.加载机制不同es是静态加载,其它是动态加载.Es6 模块的设计思想,是尽量的静态化,使得编译时就能确定模块的依赖关系,以及输入和输出的变量.CommonJS 和 AMD.CMD 模块,都只能在运行 ...

  3. splay伸展树模板

      普通版本: struct SplayTree { ; ], key[maxn], val[maxn], sz[maxn], lz[maxn], fa[maxn]; , ) { ch[x][]=ch ...

  4. CSS3、SVG、Canvas、WebGL动画精选整理

    一.CSS3动画 名称 用途 链接 阴影波纹特效 1.元素hover效果 2.突出表现效果 http://www.jq22.com/code80 横板导航菜单动画 导航菜单 http://www.jq ...

  5. python requests的使用说明

    #GET参数实例 requests.get('http://www.dict.baidu.com/s', params={'wd': 'python'}) #或 url = 'http://www.b ...

  6. Storm完整例子

    import backtype.storm.spout.SpoutOutputCollector; import backtype.storm.task.TopologyContext; import ...

  7. AVAudioSession(4):响应音频中断事件

    本文转自:AVAudioSession(4):响应音频中断事件 | www.samirchen.com 本文内容主要来源于 Responding to Interruptions. 当一个音频中断到来 ...

  8. 激活webstorm(作为一个伪前端,偶尔用用)

    推荐博客:https://blog.csdn.net/voke_/article/details/76418116 我试的方法一.

  9. OpenStack之Glance模块

    一.Glance服务 1.Glance架构 Glance架构是一个典型的CS架构,提供的也是标准的Rest接口,各个layer分层也是很清楚的. 2.Glance服务 Glance是OpenStack ...

  10. pxe无人值守自动安装

    rpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpmyum listyum upda ...