The parameter optimization is the key to study of support vector machine (SVM). With strong global search capability of bacterial foraging algorithm(BFA), the optimization method—support vector machine parameters optimization based on bacterial foraging algorithm was proposed, which can achieve the dynamic optimization of the parametersCandγ,and overcomes the problem of inefficiency for selecting reasonable parameters according to the experience in the traditional fault diagnosis. Compared with other methods, the BFA is simpler and easier for programming, and the optimization SVM model become smaller. The rolling bearing fault diagnosis results show that bacterial foraging algorithm is suitable for support vector machine parameter optimization.