国产成人精品18p,天天干成人网,无码专区狠狠躁天天躁,美女脱精光隐私扒开免费观看

mysql 5.7忘記root密碼怎么辦

發(fā)布時(shí)間:2021-09-27 17:43 來(lái)源:億速云 閱讀:0 作者:chen 欄目: Mysql 歡迎投稿:712375056

這篇文章主要講解了“ 5.7忘記root密碼怎么辦”,文中的講解內容簡(jiǎn)單清晰,易于學(xué)習與理解,下面請大家跟著(zhù)小編的思路慢慢深入,一起來(lái)研究和學(xué)習“mysql 5.7忘記root密碼怎么辦”吧!

臨時(shí)創(chuàng )建的一個(gè)測試庫,忘記了root密碼,用如下辦法可以解決:

一、通過(guò)編輯/etc/my.cnf文件在[mysqld]下面加上skip-grant-tables=1,保存退出;

[mysqld]
skip-grant-tables=1

二、重啟MySql服務(wù)

[root@iZ2ze7qh7q0di3qkvef1dzZ etc]# systemctl stop mysqld.service
[root@iZ2ze7qh7q0di3qkvef1dzZ etc]# systemctl start mysqld.service

三、以root身份登錄mysql

[root@iZ2ze7qh7q0di3qkvef1dzZ etc]# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.24 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

四、進(jìn)入mysql數據

mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed

五、修改root密碼:

mysql> update user set authentication_string = password('HecomDB2015!@#'),password_last_changed=now() where user='root';
Query OK, 2 rows affected, 1 warning (0.00 sec)
Rows matched: 2  Changed: 2  Warnings: 1

六、退出mysql,再次編輯/etc/my.cnf文件,將第一步中添加的skip-grant-tables=1刪掉,重啟啟動(dòng)MySql服務(wù)即可。

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。

久久久亚洲欧洲日产国码aⅴ| 天天综合网天天综合色| 国产农村老太xxxxhdxx| 最近高清日本免费| 亚洲AV永久久久久久久无码精品| 欧美人与动牲交A免费|