欢迎来到福编程网,本站提供各种互联网专业知识!
您的位置:网站首页 > 数据库 > Mysql

mysql登录遇到ERROR 1045问题解决方法

发布时间:2013-03-11 作者: 来源:转载
mysql登录时出现了错误:ERROR1045:Accessdeniedforuser,究竟是什么原因呢?接下来为你详细介绍下,感兴趣的你可以参考下哈,或许可以帮助到你
在Windows系统中,mysql登录的时候出现了这样的错误:ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)

从网上找了一些办法,终于得到了解决,现在记录一下具体的解决方法:
复制代码 代码如下:
c:>sc stop mysql
c:>mysqld --defaults-file="C:MySQLMySQLServer6.0my.ini" --console --skip-grant-tables

重新开一个cmd
复制代码 代码如下:
c:>mysql -uroot -p
enter password: <- 回车
mysql>UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql>FLUSH PRIVILEGES;
mysql>quit

相关推荐