As a widely used brain–computer interface (BCI) paradigm, steady-state visually evoked potential (SSVEP)-based BCIs have the advantages of high information transfer rates, high tolerance for artifacts, and robust performance across diverse users. However, the incidence of mental fatigue from prolonged, repetitive stimulation is a critical issue for SSVEP-based BCIs. Music is often used as a convenient, non-invasive means of relieving mental fatigue. This study investigates the compensatory effect of music on mental fatigue through the introduction of different modes of background music in long-duration, SSVEP-BCI tasks. Changes in electroencephalography power index, SSVEP amplitude, and signal-to-noise ratio were used to assess participants’ mental fatigue. The study’s results show that the introduction of exciting background music to the SSVEP-BCI task was effective in relieving participants’ mental fatigue. In addition, for continuous SSVEP-BCI tasks, a combination of musical modes that used soothing background music during the rest interval phase proved more effective in reducing users’ mental fatigue. This suggests that background music can provide a practical solution for long-duration SSVEP-based BCI implementation.