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