溫馨提示×

溫馨提示×

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

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

mysql5.7 忘記密碼重置

發(fā)布時間:2020-07-13 13:18:19 來源:網(wǎng)絡 閱讀:173 作者:bomby 欄目:系統(tǒng)運維

環(huán)境 centos7 ,mysql5.7


一、停服務

systemctl stop mysqld


二、修改my.cnf?

vi /etc/my.cnf

#在[mysqld]下添加一行

skip-grant-tables=1

啟動

[root@linux~]#?systemctl start mysqld


三、修改密碼

[root@linux~]# mysql

mysql>?UPDATE mysql.user SET authentication_string=PASSWORD('NEWPASSWORD'), plugin='mysql_native_password' WHERE User='root' ;

mysql>exit


四、配置注釋掉

vi /etc/my.cnf

#在[mysqld]下添加一行

#skip-grant-tables=1


五、重啟數(shù)據(jù)庫

systemctl restart mysqld



向AI問一下細節(jié)

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

AI