Mesothelioma lies one of the most malignant tumors, in which the identification of the corresponding biomarkers is extremely critical. This study aims to investigate the prognostic value of enhancer homolog 2 (EZH2) mRNA expression in mesothelioma patients accompanied with its immune infiltration analysis. Gene expression, clinical information and enrichment analysis were obtained based on the Cancer Genome Atlas (TCGA), the immune infiltration analysis and bioinformatics analysis were performed. Clinical information and gene expression were obtained from 86 patients with mesothelioma based on TCGA database. Survival analysis, GSEA enrichment analysis, and immune infiltration analysis of EZH2 expression were carried out using R (version 3.6.3) (statistical analysis and visualization). The correlation of EZH2 expression with immune cell infiltration in mesothelioma was analyzed according to the TIMER database (Fig. https://cistrome.shinyapps.io/timer/). A univariate and multivariate analysis of general data obtained from the TCGA database was performed, involving age, gender, stage, pathological type, and whether they had received radiotherapy, the results indicated the association of high expression of EZH2 with poor prognosis in mesothelioma patients, with the worse prognosis in the High group (HR = 2.75, 95% CI 1.68–4.52, P < 0.010). Moreover, ROC curves showed that EZH2 expression predicted 1-year survival with an AUC of 0.740, 2-year survival with an AUC of 0.756, and 3-year survival with an AUC of 0.692, suggesting a robust predictive effect of EZH2 expression on prognosis. KEGG pathway analysis indicated five pathways showing the strongest positive correlation with EZH2 expression: cell cycle, DNA replication, Cell adhesion molecules cams, Primary immuno deficiency, Tsate transduction, and five pathways showing the strongest negative correlation with EZH2 expression: Glycolysis gluconeogenesis, Drug metabolism, cytochrome P450, retinol metabolism, fatty acid metabolism ribosome. We investigated the correlation between EZH2 expression and the level of immune infiltration in mesothelioma tissues. The results indicated that EZH2 expression played a critical role in immune infiltration, of which the high expression was correlated with the reduced number of NK cells, Mast cells, and Th17 cells. Moreover, mesothelioma patients with high EZH2 expression differ from those with low EZH2 expression in their tumor immune microenvironment. EZH2, as a new prognostic biomarker for mesothelioma, contributes to elucidating how changes in the immune environment promote the development of mesothelioma. Further analysis, EZH2 may serve as a biological test to predict the prognosis of mesothelioma.