The study analyzed the knowledge, attitudes, and practices (KAP) regarding exercise in 383 hospitalized patients with type 2 diabetes from the endocrinology departments of seven tertiary hospitals in Hubei Province, China. The total KAP score reached 122.89 ± 24.33 points, which corresponds to a rate of 66.43%. The knowledge subscale had 49.10 ± 13.82 points (54.56%), the attitude subscale 26.44 ± 7.66 points (66.1%), and the practices subscale 47.34 ± 12.55 points (73.6%). Multivariate linear regression analysis showed that long-term residence, education, monthly income, complications, regular exercise habits, diabetes health education and family support are influencing factors of KAP (R² = 0.284, P < 0.05). Key groups for health education include patients with less education, limited income, rural household registration and no diabetic complications. Adapting education to the findings, strengthening family support, and peer communication can increase exercise-related KAP levels.