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. JQuery UI dialog 弹窗实例及参数说明

    按钮代码: <a id="suprise" style="margin-left: 0.5em;cursor:pointer;">点我会有惊喜< ...

  2. InvokeRequired 线程间访问

    zt: http://www.x2blog.cn/jinhong618/?tid=22389 问: f (this.InvokeRequired)            {               ...

  3. Redis五种数据类型命令介绍(4)

    1.string类型命令 设置值:set id 001 获取值:get id  删除键值:del id  验证键是否存在:exists id 显示所有的key:keys * incr .incrby指 ...

  4. 指令<AngularJs>

    对于指令,可以把它简单的理解成在特定DOM元素上运行的函数,指令可以扩展这个元素的功能. 首先来看个完整的参数示例再来详细的介绍各个参数的作用及用法: angular.module('myApp', ...

  5. Ubuntu菜鸟入门(四)—— 搜狗输入法

    一 搜狗输入法安装 1  下载安装包:   http://pinyin.sogou.com/linux/ 2  安装安装包 (1)"GDebi",这是一个用于安装你自己手动下载包的 ...

  6. android中如何用代码来关闭打开的相机

    场景描述: 比如你再应用中打开了系统相机,然后需要在几分钟后自动关闭这个系统相机(不是手动关闭) 1.在activityA中利用startActivityForResult(intent,reques ...

  7. windows下node环境配置

    1.在node官网上下载合适版本的node安装包,官网地址:http://nodejs.org/#download:我下载的6.5最新版本: 2.安装node,都是系统默认的,一直安装下去: 3.在c ...

  8. Java EE之servlet实现用户登录

    1.在连接数据库的JAVA类中添加查询功能: 在这之前有一个连接数据库的方法: Connection conn=null; PreparedStatement stat=null;           ...

  9. three.js贴图

    使用图像作为材质.这时候,就需要导入图像作为纹理贴图,并添加到相应的材质中 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//E ...

  10. bash 源码分析

    下载解压 bash-3.2 编译bash export LFS=/my/soft/mylfs tar xvf $LFS/sources/bash-3.2.tar.gz -C $LFS/sources/ ...