服务器:mysql登录时出现了错误:ERROR 1045: Access denied for user,是什么原因呢?
在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
Copyright © 2013-2023 . All Rights Reserved. 宵云 版权所有 南通宵云网络科技有限公司
工信部备案:苏ICP备18049042号-2
公安部备案:苏公网安备 32060102320703号
《中华人民共和国增值电信业务经营许可证》经营性ICP/ISP/IDC三证:苏B1.B2-20210805