Primary liver cancer is a prevalent and deadly cancer type. Despite treatment advances, prognosis remains poor, with high recurrence rates. Early detection is crucial but challenging due to the disease's insidious nature. Myosin proteins play significant roles in cancer development, influencing cell migration, invasion, and tumor suppression. MYL6B, a myosin light chain, is involved in various cellular processes and has been associated with poor prognosis in colorectal adenocarcinoma and potential as a biomarker in breast cancer. To investigate the expression of MYL6B in liver hepatocellular carcinoma (LIHC) and its impact on prognosis and potential mechanisms of action using bioinformatics methods. The expression of MYL6B in pan-cancer and normal tissues was analyzed using the gene expression profiling interactive analysis 2 and tumor immune estimation resource databases. The expression level of MYL6B in LIHC tissues and its relationship with prognosis were analyzed, immunohistochemical analysis of MYL6B and its effect on immune cell infiltration, and the protein network were further studied. MYL6B was highly expressed in diffuse large b-cell lymphoma, LIHC, pancreatic adenocarcinoma, skin cutaneous melanoma, thymoma, uterine corpus endometrial carcinoma, uterine carcinosarcoma, and lowly expressed in kidney chromophobe, acute myeloid leukemia, testicular germ cell tumors. The expression level of MYL6B was significantly different between cancer and normal tissues. It had a significant impact on both overall survival and disease-free survival. MYL6B is highly expressed in hepatocellular carcinoma and its expression level increases with cancer progression. High MYL6B expression is associated with poor prognosis in terms of overall survival and recurrence-free survival. The immunohistochemical level of MYL6B is high in hepatocellular carcinoma tissues, and MYL6B has a high level of immune infiltration inflammation. In protein network analysis, MYL6B is correlated with MYL2, MYL6, MYL9, MYLK4, MYLK2, MYL12A, MYL12B, MYH11, MYH9 and MYH10. The expression level of MYL6B in LIHC was significantly higher than in normal liver tissues, and it was correlated with the degree of differentiation survival rate, and immune infiltration. MYL6B is a potential target for LIHC treatment.