Physician trust is necessary for improving physician–patient relationships and maintaining an effective health-care system. Most studies on the theory of segmentation assimilation have mainly focused on comparing immigrants in different countries and few studies have applied segmented assimilation to clarify physician–patient relationships, especially physician trust among internal migrants in the context of Chinese megacities. A random sample of 1200 internal migrants was collected through an online questionnaire conducted in Shanghai from August to December 2021. An exploratory K-means cluster analysis and multivariate logistic regression models were employed to identify patterns of segmented assimilation and examine their relationships with physician trust, as well as the factors influencing physician trust among internal migrants in Shanghai. Results show four main patterns were revealed, namely first-generation classic assimilation, first-generation integrative assimilation, first-generation segmentation, and second-generation underclass assimilation, supporting the theory of segmented assimilation. Association between assimilation pattern and physician trust was observed. A relationship was found between assimilation patterns and trust in physicians. Migrants belonging to the first-generation classic and integrative assimilation groups exhibited a higher level of trust in doctors compared to those in the segmented assimilation groups. Additionally, undergraduate and postgraduate education attainment, an annual income of <400 000 yuan, visiting the physician ≥2 times in the past year, and self-rated health status before and after population floating were significant contributing factors for good physician trust. The government can implement corresponding measures to maintain physician trust, improve cultural adaptability instead of only at the economic level among internal migrants, achieving the facilitation of their understanding of the health system and health service utilization to increase physician trust.