mysql safe file priv_MYSQL的secure_file_priv参数怎么用?
MYSQL的secure_file_priv參數(shù)怎么用?
發(fā)布時間:2020-06-01 14:03:22
來源:億速云
閱讀:639
作者:Leah
MYSQL的secure_file_priv參數(shù)怎么用?針對這個問題,今天小編總結(jié)這篇有關(guān)secure_file_priv的文章,希望能幫助朋友了解secure_file_priv這個新特性。
secure-file-priv特性
secure-file-priv參數(shù)是用來限制LOAD DATA, SELECT … OUTFILE, and LOAD_FILE()傳到哪個指定目錄的。ure_file_priv的值為null ,表示限制mysqld 不允許導(dǎo)入|導(dǎo)出
當(dāng)secure_file_priv的值為/tmp/ ,表示限制mysqld 的導(dǎo)入|導(dǎo)出只能發(fā)生在/tmp/目錄下
當(dāng)secure_file_priv的值沒有具體值時,表示不對mysqld 的導(dǎo)入|導(dǎo)出做限制
如何查看secure-file-priv參數(shù)的值:
show global variables like '%secure%';
沒有導(dǎo)出權(quán)限:mysql> show global variables like '%secure%';
+------------------+-------+
| Variable_name ? ?| Value |
+------------------+-------+
| secure_auth ? ? ?| OFF ? |
| secure_file_priv | ? ? ? |
+------------------+-------+
2 rows in set (0.00 sec)
有導(dǎo)出權(quán)限,導(dǎo)出路徑需在/var/lib/mysql-files/下:mysql> show global variables like '%secure%';
+--------------------------+-----------------------+
| Variable_name ? ? ? ? ? ?| Value ? ? ? ? ? ? ? ? |
+--------------------------+-----------------------+
| require_secure_transport | OFF ? ? ? ? ? ? ? ? ? |
| secure_auth ? ? ? ? ? ? ?| ON ? ? ? ? ? ? ? ? ? ?|
| secure_file_priv ? ? ? ? | /var/lib/mysql-files/ |
+--------------------------+-----------------------+
3 rows in set (0.09 sec)
MYSQL新特性secure_file_priv對讀寫文件的影響
此開關(guān)默認(rèn)為NULL,即不允許導(dǎo)入導(dǎo)出。
解決問題:
windows下:
修改my.ini 在[mysqld]內(nèi)加入secure_file_priv=
linux下:
修改my.cnf 在[mysqld]內(nèi)加入secure_file_priv=
MYSQL新特性secure_file_priv對讀寫文件的影響
然后重啟mysql,再查詢secure_file_priv
看完上述內(nèi)容,你們對MYSQL的secure_file_priv參數(shù)有進(jìn)一步的了解嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!
總結(jié)
以上是生活随笔為你收集整理的mysql safe file priv_MYSQL的secure_file_priv参数怎么用?的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: LwIP应用开发笔记之六:LwIP无操作
- 下一篇: mysql 唯一约束 多字段_mysql