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. plsql查找不到带中文的纪录

    今天在另外的电脑用plsql查询不到带中文的记录 select * from test where name like '%测试%' 然后发现是系统的环境变量还没设置好所造成的.在系统变量加入如下变量 ...

  2. Linux的简单介绍和常用命令的介绍

    Linux的简单介绍和常用命令的介绍 本说明以Ubuntu系统为例 Ubuntu系统的安装自行百度,或者参考http://www.cnblogs.com/CoderJYF/p/6091068.html ...

  3. CozyRSS2开发记录0-win10开坑

    1.回顾 距离上一篇<CozyRSS1.0 - 有可用性版本>,恰好两个月整.在初步完成CozyRSS的WPF桌面版后,按照设想的,开始搞一个手机版的CozyRSS.由于种种原因,并没有使 ...

  4. BeautifulSoup研究一

    BeautifulSoup的文档见 https://www.crummy.com/software/BeautifulSoup/bs4/doc.zh/ 其中.contents 会将换行也记录为一个子节 ...

  5. CVE-2015-7645 analyze and exploit

    Hack team之后adobe和google合作对flash进行了大改,一度提高了flash的利用门槛,CVE-2015-7645作为第一个突破这些限制的漏洞利用方式,可以作为vetect利用方式之 ...

  6. nodejs复习05

    stream 可读流 fs.pause()方法会使处于流动模式的流停止触发data事件,切换到非流动模式并让后续数据流在内部缓冲区 var fs = require('fs') var rs = fs ...

  7. delphi 步长不等于 1 的方法

    i:=; do begin ... INC(i,); end; 不能用for循环,只能用像上面的方法折衷一下

  8. AC自动机+DP HDOJ 2457 DNA repair(DNA修复)

    题目链接 题意: 给n串有疾病的DNA序列,现有一串DNA序列,问最少修改几个DNA,能使新的DNA序列不含有疾病的DNA序列. 思路: 构建AC自动机,设定end结点,dp[i][j]表示长度i的前 ...

  9. Android 中 LayoutInflater 的使用

    一.LayoutInflater 的作用 我们一般使用 LayoutInflater 做一件事:View inflate(int resource, ViewGroup root); inflate( ...

  10. Terminology: Sandbox

    In Comupter Secuity: from https://en.wikipedia.org/wiki/Sandbox_(computer_security) In computer secu ...