The protective mechanism of tetramethylpyrazine (TMP), an alkaloid derived from the Chinese herbal remedy Ligusticum chuanxiong, in relation to myocardial ischemia/reperfusion injury (MIRI) is not yet fully understood. To investigate the therapeutic effects of TMP, we established an in vivo rat model of MIRI and an in vitro hypoxia and reoxygenation (H/R) model using H9c2 cells. First, TMP significantly reduced the infiltration of inflammatory cells in the myocardium, decreased serum levels of myocardial injury markers (CK-MB, cTnT and LDH), and alleviated myocardial infarct size in I/R rats. Additionally, TMP attenuated cell apoptosis and enhanced cell viability in H9c2 cells subjected to H/R. Furthermore, we employed NOD-like receptor protein 3 (NLRP3)-specific inhibitors (MCC950) and agonists (nigericin) to explore the role of the NLRP3 inflammasome in TMP's protective effects against MIRI. TMP was found to inhibit NLRP3 inflammasome activation and reduce caspase-1-dependent pyroptosis. We investigated the potential mechanism underlying the protective effect of TMP on MIRI using drug affinity responsive target stability (DARTS) and liquid chromatography tandem mass spectrometry (LC-MS/MS) techniques. It was found that myosin light chain-2 (Myl2) was the molecule directly responsible for TMP's protective effect on MIRI. Following TMP treatment, the protein levels of Myl2 increased in the heart tissues of the I/R rats and in H9c2 cells subjected to H/R in a dose-dependent manner. Finally, the cardioprotective effects of TMP, including the inhibition of the NLRP3 inflammasome, were partially negated by the genetic silencing of Myl2 using siRNA. This study indicated that TMP mitigated MIRI by regulating the inhibition of the Myl2-mediated NLRP3 signaling pathway.