MySQL 中出現報錯提示: ‘Variable ‘XXX‘ is a read only variable‘的解決方法
一)問題描述:
當我們檢視mysql中的 secure_file_priv引數 時,發現它的預設值是NULL,表示限制不能匯入匯出。
當我們要修改此引數時就會報錯:
二)原因分析:
因為 secure_file_priv引數是一個只讀引數,不能使用 set global命令 修改。
三)解決方法:
需要在my.ini配置檔案中更改該引數,之後重啟資料庫。如果當前的mysql版本在my.ini配置檔案中沒有找到secure_file_priv引數,那麼就開啟my.cnf 或 my.ini並新增 secure_file_priv=''
語句後重啟mysql。
此時再檢視secure_file_priv的值就成了:
四)擴充套件知識:
secure_file_priv引數用於限制LOAD DATA, SELECT …OUTFILE, LOAD_FILE()傳到哪個指定目錄:
secure_file_priv 為 NULL 時,表示限制mysqld不允許匯入或匯出。
secure_file_priv 為 /tmp 時,表示限制mysqld只能在/tmp目錄中執行匯入匯出,其他目錄不能執行。
secure_file_priv 沒有值時,表示不限制mysqld在任意目錄的匯入匯出。
相關文章
- MySQL 報錯'Variable 'XXX' is a read only variable'MySql
- Mysql:Variable 'XXXt' can't be set to the value of 'NULL'解決MySqlNull
- mysql登陸報錯mysql: unknown variable 'basedir=MySql
- PHP提示Notice: Undefined variable的解決辦法PHPUndefined
- PHP報錯“Parseerror:syntaxerror,unexpectedT_VARIABLE”的解決辦法PHPError
- 錯誤解決:Attempting to use uninitialized value VariableZed
- 問題解決local variable 'xxx' referenced before assignment
- nginx upload 模組build錯誤解決error: variable ‘result’ set but not used [-Werror=unused-but-set-variable]NginxUIError
- php中出現Strict Standards: Only variables should be passed by reference in的解決方法PHP
- variable: Type 與 Type variable
- 程式碼會引發 Notice: Undefined variable: undefined_variable 錯誤Undefined
- mysql關於variable的總結MySql
- mysql:Variable 'character_set_client' can't be set to the value of 'NULL'解決MySqlclientNull
- Variable 'character_set_client' can't be set to the value of Null的解決方法clientNull
- mysql匯入報錯Variable 'sql_notes' can't be set to the value of 'NULL'MySqlNull
- sql mysql variable autocommit (5)MySqlMIT
- SELECT INTO FROM mysql Undeclared variableMySql
- mysql中出現Unit mysql.service could not be found 的解決方法MySql
- Linux 7.0 報錯: Check if the DISPLAY variable is set. FailedLinuxAI
- global_variable VS local_variable &functionalFunction
- 解決MySql報錯:1130 - Host ‘xxx‘ is not allowed to connect to this MySQL server的方法MySqlServer
- mysql登入報錯提示:ERROR 1045 (28000)的解決方法MySqlError
- Python中的UnboundLocalError: variable referenced before assignment錯誤分析與解決PythonError
- MySQL報錯Table 'plugin' is read only [ERROR] Can't open the mysql.plugin table.MySqlPluginError
- Oracle environment variableOracle
- CSS Variable StudyCSS
- mysql遇到Variable can’t be set to the value of ‘NULL’MySqlNull
- Python的UnboundLocalError: local variable 'xxx' referenced before assignmentPythonError
- [mysql] 批量匯入提示: Variable ‘character_set_client’ can’t be set to the value of ‘NULLMySqlclientNull
- MYSQL5.5修改字符集報錯:unknown variable 'default-character-set=utf8'MySql
- Error:/etc/fstab:Read-only file system錯誤的解決辦法Error
- ThinkCMF製作文章列表 <portal:articles 標籤報錯 Undefined variable $voUndefined
- Docker 容器中“TERM environment variable not set.”問題解決Docker
- mysql 動態引數(Dynamic System Variable Summary)MySql
- Linux環境下MySQL報Table 'xxx' doesn't exist錯誤解決方法LinuxMySql
- imagick使用readImage報錯 Failed to read the file 或者沒有報錯內容的解決方法AI
- 解決問題:Variable 'time_zone' can't be set to the value of 'NULL'Null
- 【報錯】elasticsearch 報錯blocked by: [FORBIDDEN/12/index read-only / allow delete (api)]ElasticsearchBloCORBIndexdeleteAPI