当前位置:主页 > 数据库 > Mysql >

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

时间:2021-02-07 14:47:04 | 栏目:Mysql | 点击:

在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

您可能感兴趣的文章:

相关文章