有時候我們登錄Mysql輸入密碼的時候,會出現(xiàn)這種情況
mysql -u root -p
Enter Password > '密碼'
錯誤:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
或者:錯誤:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
修改my.in/my.cnf配置文件
進(jìn)入mysql安裝目錄
編輯my.ini
在[mysqld]下添加skip-grant-tables,保存即可。
使用管理員身份打開命令行
?、僦貑ysql:
1、net stop mysql 2、net start mysql
?、谶M(jìn)入mysql,登錄
mysql -u root -p
不用輸入密碼,直接回車(出現(xiàn)Enter Password 也一樣直接回車,即可登陸成功)
?、圯斎雞se mysql,修改root的密碼:
update user set authentication_string=password('新密碼') where user='root';
flush privileges;
?、芡顺觯?/p>
quit;
?、菰俅沃貑ysql:
1、net stop mysql 2、net start mysql
⑥測試是否成功就是是否登陸成功咯。
mysql -u root -p
Enter Password>'新密碼'
就不會出錯,可以登錄啦?。?!
(另外一種情況就是,,你密碼輸入錯誤了,如果是初始化后第一次登錄,出現(xiàn)這種情況的話,很大概率就是密碼錯誤,初始化后的密碼要認(rèn)真查看,可能會因為空格、小數(shù)點等符號輸錯)
以上就是解決mysql:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO/YES)的詳細(xì)內(nèi)容,更多關(guān)于ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO/YES) 的資料請關(guān)注腳本之家其它相關(guān)文章!
標(biāo)簽:福州 定西 無錫 三明 揚州 山西 阿里 溫州
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《解決mysql:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO/YES)》,本文關(guān)鍵詞 解決,mysql,ERROR,1045,28000,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。