-3

Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

  • 1
    There 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
  • 1
    Don't add additional information in comments, as that is totally undereadable. Instead edit your question. – M. Deinum Feb 28 '23 at 08:49

1 Answers1

-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