一、问题

  有时候我们登录Mysql输入密码的时候,会出现这种情况

  mysql -u root -p

  Enter Password > '密码'

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

  或者:错误:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

二、解决办法

  修改my.in/my.cnf配置文件

    进入mysql安装目录

    编辑my.ini

    在[mysqld]下添加skip-grant-tables,保存即可。

  使用管理员身份打开命令行

  ①重启mysql:

    1、net stop mysql    2、net start mysql

  ②进入mysql,登录
    mysql -u root -p
    不用输入密码,直接回车(出现Enter Password 也一样直接回车,即可登陆成功)

  ③输入use mysql,修改root的密码:
    update user set authentication_string=password('新密码') where user='root';
    flush privileges;

  ④退出:

    quit;

  ⑤再次重启mysql:

    1、net stop mysql     2、net start mysql

  ⑥测试是否成功就是是否登陆成功咯。
    mysql -u root -p

    Enter Password>'新密码'

  就不会出错,可以登录啦!!!

解决mysql:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO/YES)的更多相关文章

  1. Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using password: YSE)

    安装mysql后,使用命令登录mysql居然报错了,Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using ...

  2. MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO

    MySQL安装完server端和客户端后,登录Mysql时报错:[root@rhel204 MySQL 5.6.23-RMP]# mysqlERROR 2002 (HY000): Can't conn ...

  3. 解决Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'问题

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Red Hat Enterpris ...

  4. 转-解决Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'问题

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)   Red Hat Enterpr ...

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

  6. [mysql] ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).

    用mysql -u root -p显示ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YE ...

  7. ubuntu系统安装mysql登陆提示 解决Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'问题

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqoAAABtCAIAAADmldQYAAAe/0lEQVR4nO1dveslR3btzJGFk02GmU

  8. MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 的解决办法和原因

    这两天下载了MySQL5.7.11进行安装,发现到了初次使用输入密码的时候,不管怎样都进不去,即使按照网上说的在mysqld 下面添加skip-grant-tables也是不行,后来研究了两天,终于找 ...

  9. MySQL5.7使用错误解决:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)【取消或重设root密码】

    解决方法: 最简单方法: ⑴打开mysql中的my.ini(如果没有就将my-default.ini复制一份,并修改为my.ini): ⑵在[mysqld]下面空白行直接添加skip-grant-ta ...

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

随机推荐

  1. MaxCompute Studio提升UDF和MapReduce开发体验

    原文链接:http://click.aliyun.com/m/13990/ UDF全称User Defined Function,即用户自定义函数.MaxCompute提供了很多内建函数来满足用户的计 ...

  2. 前线观察 | AWS re:Invent 2018见闻实录

    作为云计算行业科技盛会,AWS:reInvent大会近年来越来越受关注,其中尤其被关注的分别是CEO Andy Jassy和CTO Werner Vogels的Keynote演讲.2018年11月28 ...

  3. uniq 只能相邻行去重

    uniq只可以将相邻行重复数据进行去重处理: [root@localhost /data/mysql/mysql3306]#last | cut -d ' ' -f 1 | tail -15 > ...

  4. andorid jar/库源码解析之okio

    目录:andorid jar/库源码解析 Okio: 作用: 说白了,就是一个IO库,基于java原生io.来进行操作,内部做了优化,简洁,高效.所以受到了一部分人的喜欢和使用 栗子: 读写文件. p ...

  5. rabbitmq添加自启动 centos7环境

    1.编辑一个启动脚本 [root@xxx ~]# vim /usr/local/rabbitmq/sbin/start_rabbitmq.sh 内容如下(根据自己的实际位置做替换即可) #!/bin/ ...

  6. FMT/FWT学习笔记

    目录 FMT/FWT学习笔记 FMT 快速莫比乌斯变换 OR卷积 AND卷积 快速沃尔什变换(FWT/XOR卷积) FMT/FWT学习笔记 FMT/FWT是算法竞赛中求or/and/xor卷积的算法, ...

  7. CC2530ADC转换

    一.ADC简介 ADC支持 14 位的模拟数字转换,具有多达12 位的 ENOB(有效数字位).它包括一个模拟多路转换器,具有多达8 个各自可配置的通道,以及一个参考电压发生器.转换结果通过DMA写入 ...

  8. 《C程序设计语言》 练习2-4

    问题描述 重新编写函数squeeze(s1,s2),将字符串s1中任何与字符串s2中字符匹配的字符都删除. Write an alternate version of squeeze(s1,s2) t ...

  9. Day_11【集合】扩展案例2_使用普通for循环获取集合中索引为3的元素并打印,统计集合中包含字符串"def"的数量,删除集合中的所有字符串",将集合中每个元素中的小写字母变成大写字母def",

    分析以下需求,并用代码实现 1.定义ArrayList集合,存入多个字符串"abc" "def" "efg" "def" ...

  10. 【poj 3261】Milk Patterns 后缀数组

    Milk Patterns 题意 给出n个数字,以及一个k,求至少出现k次的最长子序列的长度 思路 和poj 1743思路差不多,二分长度,把后缀分成若干组,每组任意后缀公共前缀都>=当前二分的 ...