说明:win7系统,已经装过一个安装版的mysql(服务没有启动),然后又安装了一个免安装版的mysql,然后启动该免安装版的mysql后,用root用户无法登陆(因为想着root用户默认密码是空,但是却无法登陆),如下所示:

D:\>cd D:\MySQL Server 5.1\bin

D:\MySQL Server 5.1\bin>mysql -u root mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

解决办法:
D:\MySQL Server 5.1\bin>mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.5.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

将密码重新设置(设为空)
mysql> set password for 'root'@localhost=password('');
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye

再次以root用户(密码为空)则可以登陆:
D:\MySQL Server 5.1\bin>mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.5.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

我想出现这个原因,估计是因为我之前装的这个mysql,root用户密码修改了,不是非空了。

mysql-1045(28000)错误的更多相关文章

  1. mysql学习笔记1---mysql ERROR 1045 (28000): 错误解决办法

    mysql ERROR 1045 (28000): 错误解决办法 在启动mysql服务后,登陆mysql的窗口的时候,执行mysql命令,结果报错,没法登陆.   (在安装mysql和配置的时候,我是 ...

  2. 关于mysql ERROR 1045 (28000)错误的解决办法

    错误情景: 使用Navicat打开mysql的时候弹出错误框 错误代码: ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' ( ...

  3. mysql ERROR 1045 (28000): 错误解决办法

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

  4. mysql登录时,ERROR 1045 (28000): 错误解决办法

    错误问题的描述: ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) ERROR 10 ...

  5. mysql 在登陆的时候出现error 1045 (28000): 错误解决办法

    错误显示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决方案: 1.找到配 ...

  6. 1.mysql ERROR 1045 (28000): 错误解决办法

    转自:https://www.cnblogs.com/jpwz/p/6061214.html ERROR 1045 (28000): Access denied for user 'ODBC'@'lo ...

  7. mysql学习笔记1---mysql ERROR 1045 (28000): 错误解决办法(续:深入分析)

    在命令行输入mysql -u root –p,输入密码,或通过工具连接数据库时,经常出现下面的错误信息,详细该错误信息很多人在使用MySQL时都遇到过. ERROR 1045 (28000): Acc ...

  8. mysql开启skip-name-resolve 导致root@127.0.0.1(localhost)访问引发的ERROR 1045 (28000)错误解决方案

    为什么配置skip-name-resolve? 由于mysql -h${ip} 远程访问速度过慢, mysql -uroot -p123456 根据网友经验(https://www.cnblogs.c ...

  9. mac下mysql 1045 (28000): Access denied for user 'root'@'localhost' (using password:

    新入了mac pro,安装好mysql后,用终端进入mysql遇到个问题: 1045 (28000): Access denied for user 'root'@'localhost' (using ...

  10. 登录MySQL提示ERROR 1045 (28000)错误解决方法

    今天,登录服务器准备修改数据库的一些东西.但输入密码,却进不了数据库并提示一个错误,如下图 再确认密码没错的情况下,还是进不了数据库.便在网上找到了解决方法,记录下来,供参考学习. 解决方法: 总体思 ...

随机推荐

  1. c++ 11 游记 之 decltype constexpr

    title: c++ 11 游记 1 keyword :c++ 11 decltype constexpr 作者:titer1 zhangyu 出处:www.drysaltery.com 联系:130 ...

  2. 解剖 CPU(另)

    http://itbbs.pconline.com.cn/notebook/11026377.html 话不多说,这个处理器,就是今天我们要厮杀的对象! 1. 案板上的她,静静等等手术的进行! 2. ...

  3. MVC 之 解决MVC中使用BundleConfig.RegisterBundles引用Css及js文件发布后的丢失

    在MVC3中我们这样引用资源文件: <link href="@Url.Content("~/Content/Site.css")" rel="s ...

  4. Java通过ScriptEngine 执行js脚本案例

    public static void main(String[] args) throws ScriptException, FileNotFoundException, NoSuchMethodEx ...

  5. jstat 使用日志

    如何判断JVM是否存在内存问题呢?如何判断JVM垃圾回收是否正常?一般的top指令基本上满足不了这样的需求,因为它主要监控的是总体的系统资源,很难定位到java应用程序. Jstat是JDK自带的一个 ...

  6. python知识合集

    python安装包管理  http://www.cnblogs.com/wilber2013/p/4769467.html python pip安装源管理:pypi官网的源不太好,网速慢,容易造成包下 ...

  7. 常用API文档

    Python requtets PyQuery Pascal Delphi PHP ThinkPHP5.0完全开发手册 ThinkPHP3.2.3快速入门

  8. 《Unix&Linux大学教程》学习笔记一:历史与常识

     “为什么说Unix/Linux是自由的:         因为我们可以自己组装一个操作系统:Unix/Linux内核+其他实用工具+编程工具+GUI         因为我们可以自由地获取开源工作者 ...

  9. logrotate: 管理日志文件

    Erik Troan提供了一种优秀的工具logrotate,它实现了多种多样的日志管理策略,而且在我们举例的所有发行版本上都是标准应用. logrotate的配置文件由一系列规范组成,它们说明了要管理 ...

  10. java 截取字符串

      java 截取字符串 CreationTime--2018年7月17日16点37分 Author:Marydon 1.去除最后一个字符 方式一:String 方式二:StringBuilder.S ...