Windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes

http://blog.csdn.net/japanstudylang/article/details/8024443

关闭mysql服务

net stop mysql

在任务管理器里结束mysql进程

到WINDOWS的命令行了(‘DOS’ 下),切换到你的MySQL bin目录下。 比如我的是 C:\Program Files\MySQL\MySQL Server 5.1\bin
然后敲下面的粗体的命令。注意你的my.ini位置。

C:\Program Files\MySQL\MySQL Server 5.1\bin>mysqld --defaults-file="C:\Program
Files\MySQL\MySQL Server 5.1\my.ini" --console --skip-grant-tables
090515 22:06:09 [Warning] The syntax '--log' is deprecated and will be removed i
n MySQL 7.0. Please use '--general_log'/'--general_log_file' instead.
090515 22:06:09 [Warning] The syntax '--log_slow_queries' is deprecated and will
be removed in MySQL 7.0. Please use '--slow_query_log'/'--slow_query_log_file'
instead.
090515 22:06:09 [Warning] The syntax '--log' is deprecated and will be removed i
n MySQL 7.0. Please use '--general_log'/'--general_log_file' instead.
090515 22:06:09 [Warning] The syntax '--log_slow_queries' is deprecated and will
be removed in MySQL 7.0. Please use '--slow_query_log'/'--slow_query_log_file'
instead.
090515 22:06:09 [ERROR] The update log is no longer supported by MySQL in versio
n 5.0 and above. It is replaced by the binary log. Now starting MySQL with --log
-bin='' instead.
090515 22:06:09 InnoDB: Started; log sequence number 0 324221
090515 22:06:09 [Note] mysqld: ready for connections.
Version: '5.1.33-community-log' socket: '' port: 3306 MySQL Community Server
(GPL)

看到这个结果就说明MySQL已经起来了。
再开一个DOS窗口,同样切到mysql bin目录下,
C:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -uroot mysql   (解释: -uroot mysql    后面这个mysql指的是连接到mysql库,因为跳过权限验证,所以这时候可以不用密码就可以登录mysql)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.33-community-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

到这,你就继续按 方法一:操作就行。update完表后,退出

记得每个语句后面加分号

mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit 

然后
C:\Program Files\MySQL\MySQL Server 5.1\bin>mysqladmin shutdown

然后停掉第一个cmd窗口的mysql,按CTRL+C 停止mysql

Version:  MySQL Community Server
(GPL)

看到这个结果就说明MySQL已经起来了。

之后在Windows服务管理器里正常启动MySQL服务就行了。

Windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes的更多相关文章

  1. MySql错误1045 Access denied for user 'root'@'localhost' (using password:YES) windows下的解决方案(忘记密码)

    1.进入管理员控制台停止mysql服务:net stop mysql; 2.进入mysql的安装路径,如我的安装路径为C:\Program Files\MySQL\MySQL Server 5.5,打 ...

  2. mysql: 1045 access denied for user 'root'@'localhost' using password yes

    原因是:root的密码错误了. 解决思路:关闭mysql服务,重新启动mysql服务,启动mysql的时候,指定不需要校验密码.然后登陆mysql,修改密码,退出.再重新启动mysql服务. 1.关闭 ...

  3. MySql错误1045 Access denied for user 'root'@'localhost' (using password:YES)

    1.先停止mysql服务 2.进入mysql的安装路径,找到并打开my.ini文件,找到[mysqld],在该行下面添加 skip_grant_tables,也就是通知mysql,在登陆的时候跳过密码 ...

  4. 解决MySql 数据库 提示:1045 access denied for user 'root'@'localhost' using password yes

    今天想用用MySQL 数据库  谁知道老提示 1045 access denied for user 'root'@'localhost' using password yes 最后在csdn 上找到 ...

  5. (转载)解决MySql 数据库 提示:1045 access denied for user 'root'@'localhost' using password yes

    今天想用用MySQL 数据库  谁知道老提示 1045 access denied for user 'root'@'localhost' using password yes 最后在csdn 上找到 ...

  6. wamp中的phpmyadmin打开出现:#1045 - Access denied for user 'root'@'localhost' (using password: NO)

    详细内容: MySQL said: #1045 - Access denied for user 'root'@'localhost' (using password: NO) phpMyAdmin ...

  7. windows mysql提示:1045 access denied for user 'root'@'localhost' using password yes 解决方案

    win7 MySql5.6.17提示:1045 access denied for user 'root'@'localhost' using password yes 从网上找到的解决方法,以此博客 ...

  8. 新手PHP连接MySQL数据库出问题(Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES))

    我用的环境是wampServer集成的软件包 在php连接MySQL数据库的时候老是出现这个问题Warning: mysqli_connect(): (HY000/1045): Access deni ...

  9. Windows系统下MySQL数据库出现Access denied for user 'root'@'localhost' (using password:YES) 错误

    Windows系统下MySQL数据库出现Access denied for user 'root'@'localhost' (using password:YES) 错误,(root密码错误) 处理方 ...

随机推荐

  1. war项目在tomcat上面部署

    1.war包放到webapps根目录下. 2.修改tomcat目录下的conf文件夹里面的的server.xml,在<Host></Host>之间加入: <Context ...

  2. log4net配置

    1.configuration配置 <configSections> <section name="log4net" type="log4net.Con ...

  3. MySQL性能优化总结

    一.MySQL的主要适用场景 1.Web网站系统 2.日志记录系统 3.数据仓库系统 4.嵌入式系统 二.MySQL架构图: 三.MySQL存储引擎概述 1)MyISAM存储引擎 MyISAM存储引擎 ...

  4. 攻城狮在路上(陆)-- 配置hadoop本地windows运行MapReduce程序环境

    本文的目的是实现在windows环境下实现模拟运行Map/Reduce程序.最终实现效果:MapReduce程序不会被提交到实际集群,但是运算结果会写入到集群的HDFS系统中. 一.环境说明:     ...

  5. Ajax ContentType 列表大全

    ".*"="application/octet-stream" ".001"="application/x-001" & ...

  6. android中 onResume()方法什么时候执行 ??(转)

    转自: onResume是在启动activity启动之后才能执行的,也就是恢复执行.程序正常启动:onCreate()->onStart()->onResume();正常退出:onPaus ...

  7. 【监听文件 多线程】使用java--WatchService监听文件 开启多线程copy文件

    有一个小需求: 在PC跟前没有人的时候,迅雷下载文件 至PC磁盘上,并且自动移动文件到U盘上,小主只要在走的时候取走U盘即可. 基于这个需求,有了下面这段代码:[JDK  1.8] package c ...

  8. 进击的Python【第二章】:Python基础(二)

    Python基础(二) 本章内容 数据类型 数据运算 列表与元组的基本操作 字典的基本操作 字符编码与转码 模块初探 练习:购物车程序 一.数据类型 Python有五个标准的数据类型: Numbers ...

  9. java网络编程2

    在通信双方中,ServerSocket是服务器端负责接收的一方,它负责监听指定端口,其构造函数如下: 1.ServerSocket()  throws IOException;无参构造函数,之所以存在 ...

  10. jQuery参数学习与整理

    bind---可同时为元素嵌套多个事件. blur---当输入框焦点失去时发生的事件(获得焦点参数focus与之同理) change---当元素值改变时发生的事件 click---单击事件 dbcli ...