The invention discloses a class of 2-mercapto-5-substituent-1,3,4-thia(oxa)diazole derivatives for preventing and treating bacterial and fungal diseases of crops. Due to their excellent physiological activity, these derivatives are It has received more attention in medical aspects, but its agricultural activity has not been reported yet. This study shows that these compounds can effectively inhibit bacterial disease pathogens such as rice bacterial blight, rice bacterial stripe, tobacco bacterial wilt, tomato bacterial wilt, and wheat head blight, potato late blight, and apple rot. , Pepper Fusarium Wilt, Cucumber Botrytis, Rapeseed Sclerotinia and other fungal disease pathogens. At the same time, 2-mercapto-5-substituent-1,3,4-thia(oxa)diazole derivatives are used to prevent and treat bacterial and fungal diseases of crops, with simple structure, simple preparation process, low production cost and broad application prospects . Has the following general formula.