Despite the well-known importance of a diversity of backgrounds and perspectives in biological research, women, racial and ethnic minorities, and students from non-traditional academic backgrounds remain underrepresented in the composition of university faculty. Through a study on doctoral students at a research-intensive university, we pinpoint graduate student advising as a critical component of this leaky pipeline. Graduate students from minority backgrounds reported lower levels of support from their advisors and research groups. However, working with an advisor from a similar demographic background substantially improved productivity and well-being of these students. Several other aspects of mentoring practices positively predicted student success and belonging, including frequent one-on-one meetings, empathetic and constructive feedback, and relationships with other peer or faculty mentors. Our study highlights the need to renovate graduate education with a focus on retention - not just recruitment - to best prepare students for success in scientific careers.