In order to effectively improve the identification ability for fault data of wireless sensor network, a novel mining algorithm FDMBFO (Fault Data Mining algorithm based on Bacteria Foraging Optimization) is proposed by bacteria foraging optimization. In this algorithm, the division method of distribution range is given with wavelet transform and correlation coefficient, and the objective mining function is built. Then, the solving of function is presented by bacteria foraging optimization. Finally, a simulation with actual sample data was conducted to study the key factors of FDMBFO. Compared to performance of other algorithm, the results show that, FDMBFO has better adaptability.