likes
comments
collection
share

closing bad idle connection: unexpected read from

作者站长头像
站长
· 阅读数 50

连接被MySQL关闭了,说明Go缓存的连接生命周期超过了MySQL连接的生命周期,要避免这个错误,本质上就需要这两个连接的生命周期保持一致,或者,更安全一点,Go的更短一些:

db.SetConnMaxLifetime(time.Hour)