Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Asked
Active
Viewed 280 times
-3
-
1There is far too little information. You only posted a message (which already tells you what is wrong you didn't provide the `spring.datasource.url` property in your application properties). If you did include it there is far too little informaation in your question to even begin answering this question. Please read https://stackoverflow.com/help/how-to-ask and improve your question with that knowledge. – M. Deinum Feb 28 '23 at 08:30
-
please give more detail, for example what is you jdbc driver. It is better to leave the application.properties file here – Soheil Babadi Feb 28 '23 at 08:31
-
spring.datasource.url=jdbc:mysql://localhost:3306/ss spring.datasource.username=root spring.datasource.password=root spring.jpa.hibernate.ddl-auto=update spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect server.port=81 and am using Mysql 8 and java 8 springboot 2.7.9 – Prakash Chavan Feb 28 '23 at 08:33
-
1Don't add additional information in comments, as that is totally undereadable. Instead edit your question. – M. Deinum Feb 28 '23 at 08:49
1 Answers
-1
I think you MySQL port must change to 3306, but if you are sure about port number, change your application property like that:
spring.datasource.url=jdbc:mysql://localhost:81/ss
spring.datasource.username=root spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.database-platform = org.hibernate.dialect.MySQL5Dialect
spring.jpa.generate-ddl=true
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
spring.jpa.hibernate.ddl-auto = update
Also you must check is the other dependency for other databases exists in your POM.xml or not

Soheil Babadi
- 562
- 2
- 4
- 15
-
-
Am using mysql driver ,spring data jdbc, spring data jpa dependency in my project. – Prakash Chavan Feb 28 '23 at 08:54
-
-
-
-
-
-
yes, its working but not connected with database , also not created any table in database – Prakash Chavan Feb 28 '23 at 09:19
-
The error states the `url` isn't configured. If the URL was wrong you will get a different exception (that it cannot connect to the database not that the `url` isn't specified). – M. Deinum Feb 28 '23 at 09:23
-
Hi @M.Deinum my last project on springboot 2.6.7 is working good with mysql 8 but in springboot 2.7.9 it showing error , I tried all but not working Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class – Prakash Chavan Feb 28 '23 at 09:31