mysql 时区不对
时间: 2023-08-31 10:08:52 浏览: 119
MySQL时区问题可能导致一些错误,比如时间和日期显示不正确。出现此问题的原因可能是程序时区与数据库时区不一致。为了解决这个问题,可以采取以下措施:
1. 在MySQL服务器上设置正确的时区。可以使用命令`SET time_zone = 'Asia/Shanghai';`来设置时区为北京时间。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Mysql时区问题及解决方法](https://blog.csdn.net/lxxxxxqqq/article/details/131093673)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [一文解决MySQL时区相关问题](https://blog.csdn.net/fengyuyeguirenenen/article/details/124055408)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文