Objective. Using data investigation, the microbiology of bacterial infection in patients with pulmonary infection was discussed, and its clinical characteristics were analyzed. Methods. The clinical data of 160 patients with pulmonary infection in our hospital from March 2019 to March 2021 were collected and analyzed. Blood samples were collected and cultured, and the pathogens were identified. The distribution, constituent ratio, and drug resistance of pathogens in elderly patients with pulmonary infection were analyzed. Logistics regression analysis was adopted to analyze the risk factors of pulmonary infection. Results. Of the 160 patients with pulmonary infection, 107 were males (66.88%) and 53 were females (33.13%). The age ranged from 12 to 97 years old, with an average of 63.82 ± 12.64 years old. Sevent-six patients (47.50%) were over 65 years old. Urban patients accounted for 71.88%, and rural patients accounted for 28.13%, of which workers accounted for 46.25%, and farmers and cadres each accounted for about 4%. 85.62% of smokers have smoked for more than 4 years. Eighty-five patients had chronic diseases such as coronary heart disease, hypertension, diabetes, and cerebrovascular disease. Heart failure occurred in 10.00%, old tuberculosis in 11.25%, and new tuberculosis in 5.63%. The average hospital stay of the patients was 14.93 days, and the improvement rate was 91.25%. Eleven patients died. Among the 160 patients with pulmonary infection, COPD, pneumonia, and lung cancer accounted for the highest proportions, and idiopathic pulmonary fibrosis, bronchitis dilatation, tuberculosis, and bronchial asthma also played an important role. Pathogenic bacteria were detected in 104 of the 160 elderly patients with pulmonary infection, and the detection rate was 65.00%. A total of 444 strains of pathogenic bacteria were detected, including 328 strains of Gram-negative bacteria (73.87%, mainly Klebsiella pneumoniae, Pseudomonas aeruginosa, Stenotrophomonas maltophilia, and Serratia marcescens), 28 strains of Gram-positive bacteria (6.30%, mainly Staphylococcus aureus), and 88 strains of fungi (20.00%, mainly Candida albicans). Regarding Klebsiella pneumoniae in elderly patients with pulmonary infection, the drug resistance rates were 59.72% for amoxicillin-clavulanate potassium, 52.78% for ampicillin sodium-sulbactam sodium, and 51.39% for cefazolin sodium. Regarding Pseudomonas aeruginosa, the drug resistance rates were 29.31% for ticarcillin sodium-potassium clavulanate, 27.59% for piperacillin sodium, and 24.14% for gentamicin. Regarding Stenotrophomonas maltophilia, the drug resistance rates were 79.55% for ceftazidime, 38.64% for chloramphenicol, and 31.82% for levofloxacin. Regarding Serratia marcescens, the drug resistance rates from high to low were 74.42% for cefotaxime, 72.09% for moxifloxacin, and 69.77% for gentamicin. Regarding Staphylococcus aureus in elderly patients with pulmonary infection, the drug resistance rates were 100.00% for penicillin, 61.54% for erythromycin, 61.54% for clarithromycin, and 61.54% for azithromycin. Regarding Candida albicans, the drug resistance rates from high to low were 22.41% for caspofungin, 15.52% for itraconazole, and 9.09% for fluconazole. The results of univariate analysis of pulmonary bacterial infection indicated that there were no significant differences in sex and body mass index between nonbacterial infection group and bacterial infection group (
P
>
0.05
). There were significant differences in terms of dust or harmful gas exposure, family member smoking, chronic lung disease history, age, smoking, family cooking, hospital stay, and indwelling catheter (
P
<
0.05
). Exposure to dust or harmful gases, family cooking, age, history of chronic lung disease, indwelling catheter, and length of hospital stay were risk factors for pulmonary bacterial infection (
P
<
0.05
). Conclusion. Gram-negative bacteria are the main pathogens in elderly patients with pulmonary infection. Antibiotics should be administered reasonably according to the results of the drug sensitivity test. Older age, history of chronic lung disease, catheter indwelling, and length of stay are the risk factors for pulmonary bacterial infection.