码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2014-09-12 15:05:23      阅读:255      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   os   ar   for   数据   2014   

一大早打开Navicat Lite for MySQL客户端,提示1045 access denied for user ’root’@’localhost’ using password yes,太不给力了,网上搜了很多资料,最终问题得以解决,下面将详细的解决过程分享给大家,希望遇到同样问题的同胞,少走弯路:


    1、打开DOS进入mysql下bin目录:本人:C:\Program Files\MySQL\MySQL Server 5.1\bin
    2、停止mysql服务,net stop  mysql
    3、在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
    具体操作如下图:

bubuko.com,布布扣


    4、重新打开一个DOS窗口,在C:\Program Files\MySQL\MySQL Server 5.1\bin后面输入:mysql -root 

-p
    5、提示输入密码,在Enter后面输入密码,进入mysql>
    6、在mysql>下输入:
    mysql>update ssh set password=PASSWORD(‘newpassword‘) where USER=‘root‘
    mysql>FLUSH PRIVILEGES;
    mysql>quit
    其中,ssh为数据库名称,改为自己的即可,若有多个数据库可多次update操作即可。

    具体操作如下图所示:
bubuko.com,布布扣

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

标签:style   blog   http   color   os   ar   for   数据   2014   

原文地址:http://www.cnblogs.com/duanxz/p/3968308.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!