您好,登錄后才能下訂單哦!
環(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
免責聲明:本站發(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)容。