bl双性强迫侵犯h_国产在线观看人成激情视频_蜜芽188_被诱拐的少孩全彩啪啪漫画

MySQL5.7忘記root密碼的處理方式

本篇內容主要講解“MySQL5.7忘記root密碼的處理方式”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“MySQL5.7忘記root密碼的處理方式”吧!

創新互聯主要從事網站設計制作、成都網站設計、網頁設計、企業做網站、公司建網站等業務。立足成都服務濟水街道,十多年網站建設經驗,價格優惠、服務專業,歡迎來電咨詢建站服務:028-86922220

MySQL忘記root密碼,而且不能使用操作系統認證直接進入數據庫修改密碼時,需要重置root密碼。
1、在配置文件/etc/my.cnf添加skip-grant-tables一行,跳過密碼驗證。
2、重啟mysql數據庫主進程# /etc/init.d/mysqld restart(也可以直接先停掉MySQL進程后使用skip-grant-tables參數重啟MySQL)
3、登錄數據庫修改密碼。
mysql> update user set authentication_string=password('') where user='root' and host='localhost';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> exit
這里需要修改的字段是authentication_string,這點和之前的版本不同。
4、這個時候,如果你設置的密碼太簡單,則在數據庫執行任何命令都會報類似如下錯誤:
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> show database;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database' at line 1
mysql> update user set authentication_string=password('mysql') where user='root' and host='localhost';
ERROR 1046 (3D000): No database selected
mysql> use mysql;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
5、注意:如果只想設置簡單密碼需要修改兩個全局參數:
mysql> set global validate_password_policy=0;
mysql> set global validate_password_length=1;
mysql> set global validate_password_policy=0;
       Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_length=1;
       Query OK, 0 rows affected (0.00 sec)
mysql> set password=password("mysql");
Query OK, 0 rows affected, 1 warning (0.00 sec)

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
-------------------------End--------------------------------------------------------------------------

到此,相信大家對“MySQL5.7忘記root密碼的處理方式”有了更深的了解,不妨來實際操作一番吧!這里是創新互聯網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!

分享文章:MySQL5.7忘記root密碼的處理方式
分享鏈接:http://vcdvsql.cn/article26/jhicjg.html

成都網站建設公司_創新互聯,為您提供微信小程序網站建設企業建站響應式網站網站排名面包屑導航

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

成都網站建設公司