]]>瑙e喅mysql鈥淎ccess denied for user 'root'@'localhost'鈥?杞級http://www.shnenglu.com/aa19870406/archive/2011/05/29/147642.htmlMrRightLeftMrRightLeftSun, 29 May 2011 13:00:00 GMThttp://www.shnenglu.com/aa19870406/archive/2011/05/29/147642.htmlhttp://www.shnenglu.com/aa19870406/comments/147642.htmlhttp://www.shnenglu.com/aa19870406/archive/2011/05/29/147642.html#Feedback0http://www.shnenglu.com/aa19870406/comments/commentRss/147642.htmlhttp://www.shnenglu.com/aa19870406/services/trackbacks/147642.html杞嚜錛?a >http://blogold.chinaunix.net/u1/35320/showart_305024.html 鎴戠殑緋葷粺鏄痷buntu6.06錛屾渶榪戞柊瑁呭ソ鐨刴ysql鍦ㄨ繘鍏ysql宸ュ叿鏃訛紝鎬繪槸鏈夐敊璇彁紺? # mysql -uroot -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
浣跨敤緗戜笂浠嬬粛鐨勬柟娉曚慨鏀箁oot鐢ㄦ埛鐨勫瘑鐮侊細(xì) # mysqladmin -uroot -p password 'newpassword' Enter password: mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)'
鐜板湪緇堜簬琚垜鎵懼埌浜嗚В鍐蟲柟娉曪紝濡備笅錛堣鍏堟祴璇曟柟娉曚笁錛岃阿璋紒錛夛細(xì) 鏂規(guī)硶涓錛?br style="font: normal normal normal 12px/normal song, Verdana; " /># /etc/init.d/mysql stop # mysqld_safe --user=mysql --skip-grant-tables --skip-networking & # mysql -u root mysql mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root'; mysql> FLUSH PRIVILEGES; mysql> quit
# /etc/init.d/mysql restart # mysql -uroot -p Enter password: <杈撳叆鏂拌鐨勫瘑鐮乶ewpassword>
mysql>
鏂規(guī)硶浜岋細(xì) 鐩存帴浣跨敤/etc/mysql/debian.cnf鏂囦歡涓璠client]鑺傛彁渚涚殑鐢ㄦ埛鍚嶅拰瀵嗙爜: # mysql -udebian-sys-maint -p Enter password: <杈撳叆[client]鑺傜殑瀵嗙爜> mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root'; mysql> FLUSH PRIVILEGES; mysql> quit
# mysql -uroot -p Enter password: <杈撳叆鏂拌鐨勫瘑鐮乶ewpassword>
mysql>
鏂規(guī)硶涓夛細(xì) 榪欑鏂規(guī)硶鎴戞病鏈夎繘琛岃繃嫻嬭瘯錛屽洜涓烘垜鐨剅oot鐢ㄦ埛榛樿瀵嗙爜宸茬粡琚垜淇敼榪囦簡錛岄偅浣嶆湁絀烘祴璇曚竴涓嬶紝鎶婄粨鏋滃憡璇夋垜錛岃阿璋紒錛?br style="font: normal normal normal 12px/normal song, Verdana; " /># mysql -uroot -p Enter password: <杈撳叆/etc/mysql/debian.cnf鏂囦歡涓璠client]鑺傛彁渚涚殑瀵嗙爜>