egg启动时,报错:Ignoring invalid timezone passed to Connection的解决方案

报错信息

Ignoring invalid timezone passed to Connection: +8:00. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection

分析问题

大致意思是:这个时区的设置是无效的,但是忽略了这个无效(也就是现在也能用)。现在是一个警告,以后的版本就会抛出一个错误了。

解决方案

看到网上很多解决方案是启动的时候添加:--ignore-stderr (忽视错误信息)

"start": "egg-scripts start --daemon --title=egg-server-diary",
"start-pro": "egg-scripts start --daemon --title=egg-server-diary --ignore-stderr",

这样做能用,但是没有解决根本问题。
导致这个问题的根源是egg-sequelize连接数据库的配置中timezone的格式错误。
正确的格式应该是:

+/- HH:mm

错误写法:

timezone:'+8:00'

正确写法:

timezone:'+08:00'

就少了一个0,引起的错误。

欢迎关注我的wechat,共同交流

欢迎关注.jpg

你可能感兴趣的:(egg启动时,报错:Ignoring invalid timezone passed to Connection的解决方案)