Objective: Based on the attachment theory, this paper examines the relationship between
students’ attachment anxiety and online learning anxiety, and the mediating effect of interpersonal
relationships and school connectedness in this path. Methods: Based on the data of 999 undergraduates,
the structural equation model was conducted. Results: Students with high attachment anxiety are
more likely to have anxiety, and their perception of teacher–student relationship and student–student
relationship is not good, and the level of school connectedness is low; School connectedness plays a
mediating role in students’ attachment anxiety and online learning anxiety; The comparison of multiple
mediating effects shows that there are significant differences between teacher–student relationship,
student–student relationship and school connectedness. Conclusion: The perception of school
connectedness has a greater impact on students’ learning anxiety than interpersonal relationship.