Electricity-generating bacteria as biocatalysts for microbial fuel cells (MFCs), and their species and power generation performance determine the performance of the MFC for pollution control and power generation. For that purpose, an electricity-generating bacteria isolated from the oily sludge MFCs, and adjusted the adaptability of nitrogen-to-phosphorus ratio (3.67:1, 4.67:1, 5.67:1, and 6.67:1), temperature (5 ℃, 10 ℃, 15 ℃, 20 ℃, 25 ℃, 30 ℃, 35 ℃) and pH (pH = 6, 6.5, 7, 7.5, 8). The results of this study showed that electricity-generating bacteria was identified as Bacillus cereus, with a rod-shaped cell, about 0.5-1.0 µm in length. The optimal nitrogen-phosphorus ratio, temperature and pH of MFCs were 4.67:1, 25 ℃ and pH = 7, respectively, and its output voltage was up to 168.05 mV. The study of this functional bacteria will provide beneficial assistance for the improvement of oil removal and power generation performance of oily sludge MFCs.