1. 程式人生 > 實用技巧 >MySQL問題記錄——匯入匯出許可權設定

MySQL問題記錄——匯入匯出許可權設定

MySQL問題記錄——匯入匯出許可權設定

摘要:本文主要記錄了在使用MySQL的過程中匯入匯出許可權設定時遇到的問題以及解決方案。

相關日誌

1 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled.
2 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
3 [ERROR] Failed to access directory for --secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server.

解決辦法

在配置檔案中加入:

1 [mysqld]
2 # 設定匯入匯出
3 secure-file-priv=D:\All\MySQL\file

問題說明

配置檔案裡的secure-file-priv引數是用來限制將資料匯入匯出到指定目錄的:

當值為null,表示不允許匯入匯出操作。

當值為具體的資料夾,表示匯入匯出只能在該目錄下操作,目錄不存在會報錯。

當值沒有具體值時,表示不限制匯入匯出操作的資料夾。