溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Mysql登錄出錯(cuò) user root@localhost(using password:NO)

發(fā)布時(shí)間:2020-06-08 22:01:55 來源:網(wǎng)絡(luò) 閱讀:11235 作者:運(yùn)維少年 欄目:MySQL數(shù)據(jù)庫

環(huán)境:redhat 5.7 安裝了mysql 5.0
安裝完mysql之后啟動(dòng)成功,但是使用mysql -uroot -p登錄是,密碼錯(cuò)誤,確定沒有設(shè)置過密碼
出錯(cuò)提示:Access denied for user 'root'@'localhost' (using password : No)
解決辦法如下:

1.先關(guān)閉mysql服務(wù)
xiaopeng# /etc/init.d/mysqld stop
2.輸入操作命令
xiaopeng# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
3.連接mysql
xiaopeng# mysql -uroot mysql
mysql> update user set Password=PASSWORD('newpassword') where USER='root';
mysql> flush PRIVILEGES;
mysql> quit
4.重啟mysql服務(wù)
xiaopeng# /etc/init.d/mysqld restart
xiaopeng# mysql -uroot -p
Enter password:<newpassword>

更多資源請?jiān)L問www.arppinging.com

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI