mysql启动时执行sql server_常见 mysql 启动、运行.sql 文件错误处理
1、mysql 啟動錯誤處理
查看 log:
Mac: /usr/local/var/mysql/lizhendeMacBook-Pro.local.err
根據 log 針對性的進行調整,包治百病
2、Mysql Incorrect datetime value
問題描述:
低版本的 mysql 中,數據庫轉儲 sql 文件。導入到高版本的 mysql 中報錯。報錯提示信息如下:
Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘GMT_CLEANUP’ at row
解決辦法:
登錄 mysql 后執行:
set global sql_mode='STRICT_TRANS_TABLES,STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO';
說明:sql_mode 是設置 mysql 應該支持哪些 sql 語法,以及哪種數據驗證檢查。
show variables like 'sql_mode';查看是否生效
3、ERROR : (2006, 'MySQL server has gone away’)
修改 max_allowed_packed 參數來避免:
設置:
set global max_allowed_packet=1024*1024*160;
查詢:
show global variables like 'max_allowed_packet';
4、 [ERR] 1824 - Failed to open the referenced table ‘User
5、2013 - Lost connection to MySQL server at 'reading initial communication packet', system error: 54 "Connection reset by peer”
總結
以上是生活随笔為你收集整理的mysql启动时执行sql server_常见 mysql 启动、运行.sql 文件错误处理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 魅蓝note3多少钱啊?
- 下一篇: 《从庾中郎游园山石室诗》第七句是什么