分析mysqld的skip-grant-tables選項

這篇文章主要講解了“分析MySQLd的skip-grant-tables選項”,文中的講解內(nèi)容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“分析mysqld的skip-grant-tables選項”吧!

超過十載行業(yè)經(jīng)驗,技術(shù)領(lǐng)先,服務至上的經(jīng)營模式,全靠網(wǎng)絡和口碑獲得客戶,為自己降低成本,也就是為客戶降低成本。到目前業(yè)務范圍包括了:成都網(wǎng)站制作、成都做網(wǎng)站,成都網(wǎng)站推廣,成都網(wǎng)站優(yōu)化,整體網(wǎng)絡托管,小程序開發(fā),微信開發(fā),成都App制作,同時也可以讓客戶的網(wǎng)站和網(wǎng)絡營銷和我們一樣獲得訂單和生意!

這個選項會導致不使用權(quán)限系統(tǒng)來啟動服務器,它將讓任何用戶可以訪問服務器并且不受限制的訪問所有數(shù)據(jù)庫。在不使用授權(quán)表啟動服務器后可以通過shell來執(zhí)行mysqladmin flush-privileges或mysqladmin reload命令或者在連接到服務器后執(zhí)行flush privileges語句來讓正在運行的服務器再次使用授權(quán)表。

使用--skip-grant-tables選項啟動服務器

[root@localhost mysql]# service mysqld stop
Shutting down MySQL. SUCCESS! 
[root@localhost mysql]# service mysqld start --skip-grant-tables
Starting MySQL.. SUCCESS!

現(xiàn)在就可以不使用用戶和密碼就可以登錄服務器

[mysql@localhost ~]$ mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.26-log Source distribution
Copyright (c) 2000, 2019, 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.
mysql>

現(xiàn)在可以執(zhí)行mysqladin flush-privileges命令讓正在運行的服務器再次使用授權(quán)表

[mysql@localhost ~]$ mysqladmin  flush-privileges

現(xiàn)在不使用用戶和密碼就不能登錄服務器了,必須使用用戶和密碼才能登錄了

[mysql@localhost ~]$ mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[mysql@localhost ~]$ mysql -uroot -pabcd mysql
mysql: [Warning] Using a password on the command line interface can be insecure.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.26-log Source distribution
Copyright (c) 2000, 2019, 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.

再次使用--skip-grant-tables選項啟動服務器

[root@localhost mysql]# service mysqld stop
Shutting down MySQL.. SUCCESS! 
[root@localhost mysql]# service mysqld start --skip-grant-tables
Starting MySQL.. SUCCESS!

現(xiàn)在就可以不使用用戶和密碼就可以登錄服務器

[mysql@localhost ~]$ mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.26-log Source distribution
Copyright (c) 2000, 2019, 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.
mysql>

現(xiàn)在可以執(zhí)行mysqladin reload命令讓正在運行的服務器再次使用授權(quán)表

mysql@localhost ~]$ mysqladmin reload

現(xiàn)在不使用用戶和密碼就不能登錄服務器了,必須使用用戶和密碼才能登錄了

[mysql@localhost ~]$ mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[mysql@localhost ~]$ mysql -uroot -pabcd mysql
mysql: [Warning] Using a password on the command line interface can be insecure.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.26-log Source distribution
Copyright (c) 2000, 2019, 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.

再次使用--skip-grant-tables選項啟動服務器

[root@localhost mysql]# service mysqld stop
Shutting down MySQL. SUCCESS! 
[root@localhost mysql]# service mysqld start --skip-grant-tables
Starting MySQL.. SUCCESS!

現(xiàn)在就可以不使用用戶和密碼就可以登錄服務器

[mysql@localhost ~]$ mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.26-log Source distribution
Copyright (c) 2000, 2019, 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.
mysql>

現(xiàn)在可以執(zhí)行flush privileges語句讓正在運行的服務器再次使用授權(quán)表

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

現(xiàn)在不使用用戶和密碼就不能登錄服務器了,必須使用用戶和密碼才能登錄了

[mysql@localhost ~]$ mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[mysql@localhost ~]$ mysql -uroot -pabcd mysql
mysql: [Warning] Using a password on the command line interface can be insecure.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.26-log Source distribution
Copyright (c) 2000, 2019, 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.

--skip-grant-tables選項也可以在選項文件my.cnf中進行設(shè)置。這個選項還會導致服務器在啟動過程中禁止加載用戶定義函數(shù)(udf),調(diào)度事件和安裝插件語句中安裝的插件。為了以任何方式來加載插件,使用--plugin-load選項。--skip-grant-tables選項也會導致disabled_storage_engines系統(tǒng)變量失效。

flush privileges語句可以在服務器啟動后通過執(zhí)行其它操作來隱式執(zhí)行。例如在升級過程中mysql_upgrade程序就會刷新權(quán)限。

感謝各位的閱讀,以上就是“分析mysqld的skip-grant-tables選項”的內(nèi)容了,經(jīng)過本文的學習后,相信大家對分析mysqld的skip-grant-tables選項這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識點的文章,歡迎關(guān)注!

網(wǎng)頁題目:分析mysqld的skip-grant-tables選項
文章出自:http://bm7419.com/article14/igepde.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊自適應網(wǎng)站、Google、網(wǎng)站策劃、網(wǎng)站營銷、商城網(wǎng)站

廣告

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

成都定制網(wǎng)站建設(shè)