今天配置一个本地网站,用于测试,用的phpstudy,数据库密码等都配置好了,但是出现
MYSQL 报错:SQLSTATE [HY000] [1045] Access denied for user ‘root’@’localhost’ (using password:yes)
其实这种错误只要打开马蹄,进入命令行界面,输入三行代码即可
进入 MYSQL,按照以下三步依次执行:
SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘123456’);
GRANT ALL PRIVILEGES ON *.* TO ‘root’ @’%’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;
flush privileges;
注:123456 为你需要设置的数据库密码