mydb connect middleware