MySQL-在windows下 1045 access denied for user 'root'@'localhost' using password yes 解决办法 (转)

在windows下 1045 access denied for user 'root'@'localhost' using password yes 解决办法

转自:http://blog.csdn.net/wdw004/article/details/4866475

http://www.cnblogs.com/wdw004/article/details/4866475

在windows下的解决办法如下:

 

    1.net stop mysql 停用服务

    2.修改${mysql_home}/MySQL Server 5.1目录下的my.ini文件

          [mysqld]下面添加这句:
              skip_grant_tables

 

    3.把你的${mysql_home}/bin目录加入path路径里边(备注:这一步在安装时候已经设置好了)

    4.net start mysql 启动mysql服务

    5.mysql -uroot -p
       Enter password:root

 

    6.mysql>UPDATE user SET Password=PASSWORD('root') where USER='root';
       mysql>FLUSH PRIVILEGES;
       mysql>exit

 

    7.删除my.ini中的这句话:skip_grant_tables
       net stop mysql
       net start mysql

      

    8.再次登录

       mysql -uroot -proot
       mysql>

posted @ 2012-02-05 10:34  ymingkm  阅读(659)  评论(0编辑  收藏  举报