当前位置:Gxlcms >
数据库问题 >
数据库出现1045 access denied for user 'root'@'localhost' using password yes (转)
数据库出现1045 access denied for user 'root'@'localhost' using password yes (转)
时间:2021-07-01 10:21:17
帮助过:2人阅读
在mysql命令行中执行
SET PASSWORD FOR ‘root‘@‘localhost‘ = PASSWORD(‘123456‘);
GRANT ALL PRIVILEGES ON *.* TO ‘root‘ @‘%‘ IDENTIFIED BY ‘123456‘ WITH GRANT OPTION;
flush privileges;
若以上方法行不通则用:
use mysql;
UPDATE user SET Password=PASSWORD(‘123456‘) where USER=‘root‘;
flush privileges;数据库出现1045 access denied for user 'root'@'localhost' using password yes (转)
标签: