This article provides a detailed solution to the “com.mongodb.MongoSocketOpenException: Connection refused” error that occurs when starting a Spring Boot project—even without any MongoDB configuration. It explains why the mongodb-driver-sync dependency triggers auto-configuration and offers two methods to disable MongoAutoConfiguration, helping developers quickly troubleshoot similar issues. 1. Background & Environment Overview To meet business requirements, a…