MySQL manage disconnection then reconnect


(Leonardo Gazio) #1

Hey there, is there any way to detect when database connection has been lost, then reconnect? I need to do that because I’m working on a remote MySQL db…

Tnx.


(George Calianu) #2

Try https://golang.org/pkg/database/sql/#DB.Ping