Adds closing connections to mysql