mysql Warning
今天重啟mysql錯誤日誌顯示有如下警告:
2016-06-24 09:20:07 0 [Warning] option 'general_log': boolean value '/data/DB/mysql/select.log' wasn't recognized. Set to OFF.
2016-06-24 09:20:07 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
第一個警告是查詢日誌檔案沒有找到,系統選擇關閉查詢日誌功能:
[root@trcloud-gtt-dw ~]# ls -l /data/DB/mysql/select.log
ls: cannot access /data/DB/mysql/select.log: No such file or directory
[root@trcloud-gtt-dw ~]# touch /data/DB/mysql/select.log
[root@trcloud-gtt-dw ~]# chown mysql:mysql /data/DB/mysql/select.log
透過建立檔案解決
第二個警告是要關掉這種非標準行為,得在啟動服務前開啟系統變數explicit_defaults_for_timestamp! 如此,系統方能按如下的方式處理timestamp:
timestamp欖沒有顯式宣告為not null的將會允許null值。設定為null就會是null,而不是當前timestamp!
沒有timestamp欖會被自動賦值為default current_timestamp或on update current_timestamp。而是要顯式去賦值!
timestamp欖宣告為not null並且沒有顯式宣告一個預設值將被認定為沒有預設值。向這樣的欖插入記錄將完全看SQL模式的心情。如果是strict模式,就報錯!
如果不是,將被賦值為'00-00-00 00:00:00'並給一個警告。處理DATETIME也是這樣!
透過在mysql.cnf,mysqld下面加explicit_defaults_for_timestamp=true解決
2016-06-24 09:20:07 0 [Warning] option 'general_log': boolean value '/data/DB/mysql/select.log' wasn't recognized. Set to OFF.
2016-06-24 09:20:07 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
第一個警告是查詢日誌檔案沒有找到,系統選擇關閉查詢日誌功能:
[root@trcloud-gtt-dw ~]# ls -l /data/DB/mysql/select.log
ls: cannot access /data/DB/mysql/select.log: No such file or directory
[root@trcloud-gtt-dw ~]# touch /data/DB/mysql/select.log
[root@trcloud-gtt-dw ~]# chown mysql:mysql /data/DB/mysql/select.log
透過建立檔案解決
第二個警告是要關掉這種非標準行為,得在啟動服務前開啟系統變數explicit_defaults_for_timestamp! 如此,系統方能按如下的方式處理timestamp:
timestamp欖沒有顯式宣告為not null的將會允許null值。設定為null就會是null,而不是當前timestamp!
沒有timestamp欖會被自動賦值為default current_timestamp或on update current_timestamp。而是要顯式去賦值!
timestamp欖宣告為not null並且沒有顯式宣告一個預設值將被認定為沒有預設值。向這樣的欖插入記錄將完全看SQL模式的心情。如果是strict模式,就報錯!
如果不是,將被賦值為'00-00-00 00:00:00'並給一個警告。處理DATETIME也是這樣!
透過在mysql.cnf,mysqld下面加explicit_defaults_for_timestamp=true解決
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29989552/viewspace-2120908/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql'MySql
- MySQL日誌警告'[Warning] Unsafe statement written to the binary log'MySql
- 看各路神仙如何大戰MySQL insecure warning報警有感MySql
- MYSQL Warning: World-writable config file './my.cnf' is ignoredMySql
- [WARNING] warning: Class com.google.protobuf.Descriptors not found - continuing with a stub.GoUI
- webstorm(二):拼寫warningWebORM
- InnoDB: Warning: a long semaphore waiAI
- mysql啟用skip-name-resolve模式時出現Warning的處理辦法MySql模式
- warning:reset()[function.reset]:passedvariableisnotanarrayorobjectFunctionObject
- Warning:dns_get_record():AtemporaryservererroroccurredDNSServerError
- Warning: Cannot redeclare function_name()Function
- Mysql 錯誤日誌出現大量[Warning] Aborted connection to db user host的解決思路MySql
- Warning: RPMDB altered outside of yumIDE
- ORA-12504 warning in PHPPHP
- Python忽略warning警告錯誤Python
- 【Python】關閉 warning 資訊提示Python
- WARNING:Could not lower the asynch I/O limitMIT
- WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!REMIDE
- WARNING: Oracle executable binary mismatch detectedOracle
- dedecms 搬家 / dedecms error warning!錯誤Error
- http://stackoverflow.com/questions/4219970/warning-mysql-connect-2002-no-such-file-or-directory-tryi...HTTPMySql
- PHP Warning:fopen出錯如何解決?PHP
- warning: already initialized constant FileUtils::VERSIONZed
- WARNING: Subscription for node down event still pending
- python如何忽略警告(warning) 錯誤Python
- 解決警告“ld: warning: directory not found for option”
- NMAKE : warning U4006: special macro undefined : '$MacUndefined
- redhat linux核心資訊 warning:many lost ticksRedhatLinux
- Python怎樣忽略warning警告錯誤?Python
- [git]warning: LF will be replaced by CRLF in 解決辦法Git
- 關閉VS警告 warning C4996996
- Warning: unable to open an initial console.
- RMAN-08137: WARNING: Archived Log Not DeletedHivedelete
- git warning: LF will be replaced by CRLF in 解決辦法Git
- warning: React does not recognize the xxx prop on a DOM elementReact
- SSH登入:WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!REMIDE
- Linux - SSH: WARNING REMOTE HOST IDENTIFICATION HAS CHANGEDLinuxREMIDE
- [git] warning: LF will be replaced by CRLF | fatal: CRLF would be replaced by LFGit