操作系統(tǒng) centos 6.5
mysql 5.6
關(guān)于mysql安全配置的相關(guān)內(nèi)容中看到,load_file可以用來加載文件,存在安全問題
SELECT load_file("/etc/passwd")
在本機(jī)測(cè)試后卻都是返回NULL,那到底會(huì)不會(huì)影響數(shù)據(jù)庫安全呢。
secure-file-priv特性
secure-file-priv參數(shù)是用來限制LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE()傳到哪個(gè)指定目錄的。
如何查看secure-file-priv參數(shù)的值:
show global variables like '%secure%';
secure_auth | ON |
secure_file_priv | /var/lib/mysql-files/ |
可以看到已經(jīng)默認(rèn)限制了路徑,如果擔(dān)心會(huì)有被寫入文件的可能,在配置文件中設(shè)置local-infile=0
參考資料:
https://segmentfault.com/a/1190000009333563
http://blog.csdn.net/listen_for/article/details/53907270
http://blog.csdn.net/xiaolang85/article/details/52094164
- 版權(quán)所有:奇站網(wǎng)絡(luò) 轉(zhuǎn)載請(qǐng)注明出處
- 廈門奇站網(wǎng)絡(luò)科技有限公司,專業(yè)提供網(wǎng)站建設(shè),響應(yīng)式網(wǎng)站建設(shè),小程序開發(fā),系統(tǒng)定制開發(fā)。
- 軟件開發(fā)咨詢熱線:吳小姐 13313868605