Bird
0
0

A developer sets spring.datasource.url=jdbc:mysql://localhost:3306/db in application.properties but the app fails to connect. What could be a configuration mistake?

medium📝 Debug Q7 of 15
Spring Boot - Application Configuration
A developer sets spring.datasource.url=jdbc:mysql://localhost:3306/db in application.properties but the app fails to connect. What could be a configuration mistake?
AUsing wrong port number 3306
BMissing username and password properties
CDatabase URL must be in uppercase
DDatasource URL should be in YAML format
Step-by-Step Solution
Solution:
  1. Step 1: Check required datasource properties

    Besides URL, username and password are needed to connect to DB.
  2. Step 2: Evaluate other options

    Port 3306 is default for MySQL, URL case does not matter, and properties file format is correct.
  3. Final Answer:

    Missing username and password properties -> Option B
  4. Quick Check:

    DB connection needs URL, username, and password [OK]
Quick Trick: DB connection needs URL plus username and password [OK]
Common Mistakes:
  • Forgetting username/password
  • Changing default port unnecessarily
  • Confusing file formats

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes