当前位置: 移动技术网 > IT编程>数据库>Mysql > mysql登录遇到ERROR 1045问题解决方法

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

2017年12月12日  | 移动技术网IT编程  | 我要评论
在windows系统中,mysql登录的时候出现了这样的错误:error 1045: access denied for user: 'root@localhost' (using password: yes)

从网上找了一些办法,终于得到了解决,现在记录一下具体的解决方法:
复制代码 代码如下:

c:\>sc stop mysql
c:\>mysqld --defaults-file="c:\mysql\mysqlserver6.0\my.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

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网