這篇文章主要講解了“分析MySQLd的skip-grant-tables選項(xiàng)”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“分析mysqld的skip-grant-tables選項(xiàng)”吧!
超過(guò)十載行業(yè)經(jīng)驗(yàn),技術(shù)領(lǐng)先,服務(wù)至上的經(jīng)營(yíng)模式,全靠網(wǎng)絡(luò)和口碑獲得客戶,為自己降低成本,也就是為客戶降低成本。到目前業(yè)務(wù)范圍包括了:成都網(wǎng)站制作、成都做網(wǎng)站,成都網(wǎng)站推廣,成都網(wǎng)站優(yōu)化,整體網(wǎng)絡(luò)托管,小程序開(kāi)發(fā),微信開(kāi)發(fā),成都App制作,同時(shí)也可以讓客戶的網(wǎng)站和網(wǎng)絡(luò)營(yíng)銷(xiāo)和我們一樣獲得訂單和生意!
這個(gè)選項(xiàng)會(huì)導(dǎo)致不使用權(quán)限系統(tǒng)來(lái)啟動(dòng)服務(wù)器,它將讓任何用戶可以訪問(wèn)服務(wù)器并且不受限制的訪問(wèn)所有數(shù)據(jù)庫(kù)。在不使用授權(quán)表啟動(dòng)服務(wù)器后可以通過(guò)shell來(lái)執(zhí)行mysqladmin flush-privileges或mysqladmin reload命令或者在連接到服務(wù)器后執(zhí)行flush privileges語(yǔ)句來(lái)讓正在運(yùn)行的服務(wù)器再次使用授權(quán)表。
使用--skip-grant-tables選項(xiàng)啟動(dòng)服務(wù)器
[root@localhost mysql]# service mysqld stop Shutting down MySQL. SUCCESS! [root@localhost mysql]# service mysqld start --skip-grant-tables Starting MySQL.. SUCCESS!
現(xiàn)在就可以不使用用戶和密碼就可以登錄服務(wù)器
[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命令讓正在運(yùn)行的服務(wù)器再次使用授權(quán)表
[mysql@localhost ~]$ mysqladmin flush-privileges
現(xiàn)在不使用用戶和密碼就不能登錄服務(wù)器了,必須使用用戶和密碼才能登錄了
[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選項(xiàng)啟動(dòng)服務(wù)器
[root@localhost mysql]# service mysqld stop Shutting down MySQL.. SUCCESS! [root@localhost mysql]# service mysqld start --skip-grant-tables Starting MySQL.. SUCCESS!
現(xiàn)在就可以不使用用戶和密碼就可以登錄服務(wù)器
[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命令讓正在運(yùn)行的服務(wù)器再次使用授權(quán)表
mysql@localhost ~]$ mysqladmin reload
現(xiàn)在不使用用戶和密碼就不能登錄服務(wù)器了,必須使用用戶和密碼才能登錄了
[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選項(xiàng)啟動(dòng)服務(wù)器
[root@localhost mysql]# service mysqld stop Shutting down MySQL. SUCCESS! [root@localhost mysql]# service mysqld start --skip-grant-tables Starting MySQL.. SUCCESS!
現(xiàn)在就可以不使用用戶和密碼就可以登錄服務(wù)器
[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語(yǔ)句讓正在運(yùn)行的服務(wù)器再次使用授權(quán)表
mysql> flush privileges; Query OK, 0 rows affected (0.12 sec)
現(xiàn)在不使用用戶和密碼就不能登錄服務(wù)器了,必須使用用戶和密碼才能登錄了
[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選項(xiàng)也可以在選項(xiàng)文件my.cnf中進(jìn)行設(shè)置。這個(gè)選項(xiàng)還會(huì)導(dǎo)致服務(wù)器在啟動(dòng)過(guò)程中禁止加載用戶定義函數(shù)(udf),調(diào)度事件和安裝插件語(yǔ)句中安裝的插件。為了以任何方式來(lái)加載插件,使用--plugin-load選項(xiàng)。--skip-grant-tables選項(xiàng)也會(huì)導(dǎo)致disabled_storage_engines系統(tǒng)變量失效。
flush privileges語(yǔ)句可以在服務(wù)器啟動(dòng)后通過(guò)執(zhí)行其它操作來(lái)隱式執(zhí)行。例如在升級(jí)過(guò)程中mysql_upgrade程序就會(huì)刷新權(quán)限。
感謝各位的閱讀,以上就是“分析mysqld的skip-grant-tables選項(xiàng)”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)分析mysqld的skip-grant-tables選項(xiàng)這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!
網(wǎng)頁(yè)題目:分析mysqld的skip-grant-tables選項(xiàng)
文章出自:http://aaarwkj.com/article14/igepde.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊(cè)、自適應(yīng)網(wǎng)站、Google、網(wǎng)站策劃、網(wǎng)站營(yíng)銷(xiāo)、商城網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)