MySQL 報錯'Variable 'XXX' is a read only variable'
設定引數時報錯
mysql> set global secure_file_priv='/database/percona';
ERROR 1238 (HY000): Variable 'secure_file_priv' is a read only variable
報錯原因:
引數為只讀引數,需要在配置檔案中更改該引數,之後重啟資料庫
[mysql@localhost percona]$ bin/mysqladmin -uroot -S /u01/mysql_data/mysql.sock shutdown -p
Enter password:
2017-03-13T10:38:21.340514Z mysqld_safe mysqld from pid file /u01/mysql_data/localhost.localdomain.pid ended
[1]+ Done bin/mysqld_safe --defaults-file=/u01/mysql_data/my.cnf
[mysql@localhost percona]$ vim /u01/mysql_data/my.cnf
[mysqld]
secure_file_priv='/database/percona'
[mysql@localhost percona]$ bin/mysqld_safe --defaults-file=/u01/mysql_data/my.cnf &
[1] 28543
[mysql@localhost percona]$ mysqld_safe Adding '/database/percona/lib/mysql/libjemalloc.so.1' to LD_PRELOAD for mysqld
2017-03-13T10:46:33.142327Z mysqld_safe Logging to '/u01/mysql_data/mysqld_error.log'.
2017-03-13T10:46:33.143853Z mysqld_safe Logging to '/u01/mysql_data/mysqld_error.log'.
2017-03-13T10:46:33.166624Z mysqld_safe Starting mysqld daemon with databases from /u01/mysql_data
mysql> set global secure_file_priv='/database/percona';
ERROR 1238 (HY000): Variable 'secure_file_priv' is a read only variable
報錯原因:
引數為只讀引數,需要在配置檔案中更改該引數,之後重啟資料庫
[mysql@localhost percona]$ bin/mysqladmin -uroot -S /u01/mysql_data/mysql.sock shutdown -p
Enter password:
2017-03-13T10:38:21.340514Z mysqld_safe mysqld from pid file /u01/mysql_data/localhost.localdomain.pid ended
[1]+ Done bin/mysqld_safe --defaults-file=/u01/mysql_data/my.cnf
[mysql@localhost percona]$ vim /u01/mysql_data/my.cnf
[mysqld]
secure_file_priv='/database/percona'
[mysql@localhost percona]$ bin/mysqld_safe --defaults-file=/u01/mysql_data/my.cnf &
[1] 28543
[mysql@localhost percona]$ mysqld_safe Adding '/database/percona/lib/mysql/libjemalloc.so.1' to LD_PRELOAD for mysqld
2017-03-13T10:46:33.142327Z mysqld_safe Logging to '/u01/mysql_data/mysqld_error.log'.
2017-03-13T10:46:33.143853Z mysqld_safe Logging to '/u01/mysql_data/mysqld_error.log'.
2017-03-13T10:46:33.166624Z mysqld_safe Starting mysqld daemon with databases from /u01/mysql_data
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-2135259/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL 中出現報錯提示: ‘Variable ‘XXX‘ is a read only variable‘的解決方法MySql
- mysql登陸報錯mysql: unknown variable 'basedir=MySql
- variable: Type 與 Type variable
- Mysql:Variable 'XXXt' can't be set to the value of 'NULL'解決MySqlNull
- 程式碼會引發 Notice: Undefined variable: undefined_variable 錯誤Undefined
- 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
- Linux 7.0 報錯: Check if the DISPLAY variable is set. FailedLinuxAI
- global_variable VS local_variable &functionalFunction
- mysql關於variable的總結MySql
- 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
- nginx upload 模組build錯誤解決error: variable ‘result’ set but not used [-Werror=unused-but-set-variable]NginxUIError
- MYSQL5.5修改字符集報錯:unknown variable 'default-character-set=utf8'MySql
- PHP報錯“Parseerror:syntaxerror,unexpectedT_VARIABLE”的解決辦法PHPError
- ThinkCMF製作文章列表 <portal:articles 標籤報錯 Undefined variable $voUndefined
- mysql 動態引數(Dynamic System Variable Summary)MySql
- 問題解決local variable 'xxx' referenced before assignment
- Python的UnboundLocalError: local variable 'xxx' referenced before assignmentPythonError
- 錯誤解決:Attempting to use uninitialized value VariableZed
- 【報錯】elasticsearch 報錯blocked by: [FORBIDDEN/12/index read-only / allow delete (api)]ElasticsearchBloCORBIndexdeleteAPI
- compact (): Undefined variable: operatorUndefined
- Bex Query variable Type 說明
- JDBC/MYSQL問題 : Unknown system variable 'query_cache_size'JDBCMySql
- When you issue "ALTER TABLESPACE xxx READ ONLY",what will oracle do?Oracle
- To add private variable to this Javascript literal objectJavaScriptObject
- TCL: 變數和過程variable變數
- Creating Test Script With Bind Variable
- oracle 繫結變數(bind variable)Oracle變數
- How to use sql result stored on shell variable?SQL
- Methods with Variable Argument Lists (var-args)
- cannot access local variable where it is not associated with a value
- mysql:Variable 'character_set_client' can't be set to the value of 'NULL'解決MySqlclientNull
- 引人矚目的 CSS 變數(CSS Variable)CSS變數
- Innodb Read Only Mode