In the present study, conditions for Bacillus mucilaginous fermentation using Agaricus bisporus wastewater as culture medium were optimized. We analyzed the total number of living B. mucilaginous in the fermentation broth using multispectral imaging flow cytometry. Single-factor experiments were carried out, where a Plackett–Burman design was used to screen out three factors from the original six factors of processing wastewater solubility, initial pH, inoculum size, liquid volume, culture temperature, and rotation speed that affected the total number of viable B. mucilaginous. The Box–Behnken response surface method was used to optimize interactions between the three main factors and predict optimal fermentation conditions. Factors significantly affecting the total number of viable B. mucilaginous, including shaking speed, culturing temperature, and initial pH, were investigated. The optimum conditions for B. mucilaginous fermentation in A. bisporus wastewater were a rotational speed of 195 rpm, culture temperature of 29 °C, initial pH of 6.5, solubility of 0.5%, 8% inoculation volume, and 90 mL liquid volume in a 250 mL flask, culture time of 48 h. Under these conditions, the concentration of total viable bacteria reached 2.16 ± 0.02 × 108 Obj/mL, which meets the national standard. A. bisporus wastewater can be used for the cultivation of B. mucilaginous.