Objective. To study the protective effect of trimetazidine on myocardial cells in rats with myocardial infarction and explore its effect on ERK signaling pathway. Methods. 40 SD rats were randomly divided into the sham operation group, model group, low-dose group, and high-dose group (intra-abdominal injection of trimetazidine 5 mg/kg and 10 mg/kg, respectively), construction of rat myocardial infarction model by coronary artery left anterior descending artery ligation. 7 days after surgery, the survival rate and cardiac function of each group of rats were recorded. The myocardial infarct size was detected by TTC staining. The apoptosis level of rat cardiomyocytes was detected by TUNEL staining. The content of ROS in rat cardiomyocytes was detected by DCFH-DA. Western-blot was used to detection of Caspase-3, Bcl-2/Bax, and ERK signaling pathway-related proteins in myocardial tissue. Results. Compared with the model group, the survival rate of the rats in the low-dose group and the high-dose group was significantly increased (
P
<
0.01
), the cardiac function was significantly improved (
P
<
0.01
), the myocardial infarct size was significantly decreased (
P
<
0.01
), the level of apoptosis was significantly decreased (
P
<
0.01
), the content of ROS in cardiomyocytes was significantly decreased (
P
<
0.01
), the protein expression of Caspase-3 and NF-κB in cardiomyocytes was significantly decreased (
P
<
0.01
), and the expression of Bcl-2/Bax and p-ERK were significantly increased (
P
<
0.01
). Conclusion. Trimetazidine can activate ERK signaling pathway in cardiomyocytes of rats with myocardial infarction, increase the expression of p-ERK, decrease the content of ROS in cardiomyocytes, decrease the expression of apoptotic proteins, reduce myocardial infarct size, improve cardiac function, and increase myocardial function.