天天看點

「MySQL問題3」ERROR 1045 (28000):……(using password: YES)

作者:Yoyo柒桃子

【簡介】

在登入mysql時忘記密碼,輸入“mysql -u root -p”指令,輸入密碼後,出現報錯“ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)”,下面給出解決辦法。

【解決方法】

步驟1:輸入“cd C:\Program Files\MySQL\MySQL Server 5.7\bin”,切換到mysql的bin目錄下,如果已經在該目錄下就不用動了;

「MySQL問題3」ERROR 1045 (28000):……(using password: YES)

步驟2:在該目錄下輸入“mysqld --console --skip-grant-tables --shared-memory”,這時會運作出很多資訊;

「MySQL問題3」ERROR 1045 (28000):……(using password: YES)

步驟3:再輸入“mysql -u root -p”可以看到不用密碼就可以進入到mysql中啦,下次再輸入“mysql -u root -p”時也不用密碼就可以登入了;

【PS:修改密碼的語句“ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';”】

「MySQL問題3」ERROR 1045 (28000):……(using password: YES)

你成功了嗎?記得點贊收藏+關注哦!

繼續閱讀