Chronic cancer pain is one of the most unbearable symptoms for the patients with advanced cancer. The treatment of cancer pain continues to possess a major challenge. Here, we report that adjusting gut microbiota via probiotics can reduce bone cancer pain (BCP) in rats. The model of BCP was produced by tumor cell implantation (TCI) to the tibia in rats. Continuous feeding of Lactobacillus rhamnosus GG (LGG) was used to modulate the gut microbiota. Mechanical allodynia, bone destruction, fecal microbiota, and neurochemical changes in the primary dorsal root ganglion (DRG) and the spinal dorsal horn (DH) were assessed. LGG supplementation (109 CFU/rat/day) delayed the production of BCP for 3-4 days and significantly alleviated mechanical allodynia within the first 2 weeks after TCI. TCI-induced proinflammatory cytokines TNF-α and IL-β in the DH, and TCI-induced bone destruction in the tibia were both significantly reduced following LGG supplementation examined on day 8 after TCI. Meanwhile, we found that LGG supplementation, in addition to inhibiting TCI-induced pain, resulted in a significantly increased expression of the μ-opioid receptor (MOR) in the DH, but not in the DRG. LGG supplementation significantly potentiated the analgesic effect of morphine. Furthermore, LGG supplementation led to an increase in butyrate levels in the feces and serum and a decrease in histone deacetylase 2 (HDAC2) expression in the DH. Feeding TCI-rats with sodium butyrate solution alone, at a dose of 100 mg/kg, resulted in decreased pain, as well as decreased HDAC2 expression and increased MOR expression in the DH. The increased expression of MOR and decreased HDAC2 were also observed in neuro-2a cells when we treated the cells with serum from TCI rats with supplementation of LGG or sodium butyrate. This study provides evidence that reshaping the gut microbiota with probiotics LGG can delay the onset of cancer pain. The butyrate-HDAC2-MOR pathway may be the underlying mechanism for the analgesic effect of LGG. These findings shed light on an effective, safe, and non-invasive approach for cancer pain control and support the clinical implication of probiotics supplementation for patients with BCP.