------------备份------------
mysqldump -ujesoutletshop -pH6GMBd8jEBzxESNC --database jesoutletshop>nflstores.sql
------------还原------------
mysql -hhostname -uusername -ppassword databasename < backupfile.sql
gunzip -f </home/wwwroot/jeseys.top/jesey_op_20210526_102248.sql.gz| mysql -u root -predhat jesey_shop
=================================
解决问题:Variable 'time_zone' can't be set to the value of 'NULL'
这个问题的原因是因为数据sql文件内部有注释,去掉就可以了 ( 最前面几行注释即可 )
/*!40000 ALTER TABLE `t_error_identification` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
=================================
解决问题:
ERROR 2006 (HY000) at line 3386: MySQL server has gone away
【解决方案】
vim /etc/my.cnf
找到 my.cnf 文件,在 [mysqld] 节点下面,增加下面三行代码(主要是第一行)
max_allowed_packet=200M
wait_timeout=2880000
interactive_timeout=2880000