Added thread safe mysql engine