mysql启动时执行sql server_常见 mysql 启动、运行.sql 文件错误处理
1、mysql 啟動(dòng)錯(cuò)誤處理
查看 log:
Mac: /usr/local/var/mysql/lizhendeMacBook-Pro.local.err
根據(jù) log 針對(duì)性的進(jìn)行調(diào)整,包治百病
2、Mysql Incorrect datetime value
問(wèn)題描述:
低版本的 mysql 中,數(shù)據(jù)庫(kù)轉(zhuǎn)儲(chǔ) sql 文件。導(dǎo)入到高版本的 mysql 中報(bào)錯(cuò)。報(bào)錯(cuò)提示信息如下:
Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘GMT_CLEANUP’ at row
解決辦法:
登錄 mysql 后執(zhí)行:
set global sql_mode='STRICT_TRANS_TABLES,STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO';
說(shuō)明:sql_mode 是設(shè)置 mysql 應(yīng)該支持哪些 sql 語(yǔ)法,以及哪種數(shù)據(jù)驗(yàn)證檢查。
show variables like 'sql_mode';查看是否生效
3、ERROR : (2006, 'MySQL server has gone away’)
修改 max_allowed_packed 參數(shù)來(lái)避免:
設(shè)置:
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”
總結(jié)
以上是生活随笔為你收集整理的mysql启动时执行sql server_常见 mysql 启动、运行.sql 文件错误处理的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 魅蓝note3多少钱啊?
- 下一篇: mysql 排序去重复_php mysq