I think your problem is password-error. If you cannot resolve the question, try to check the things below. Or you can try to connect your mysql server by IDE first.
- make sure you open mysql service, you can test connect it with IDE database function, like IDEA.
- take care of
useSSL=false
, sometimes it will be fatal.
- If your mysql-connector-java's version is above 8.*, that you might need to change the datasource-driver-name to com.mysql.cj.jdbc.Driver
Though spring will help you change.
- If you specify jpa with table's names, columns. Make sure you use the right grammar
@Table(name='xxx')
@Column(name= 'xxx')
- Take care of the mysql server's port.
In windows. netstat -ano |findstr: 3306
taskkill /PID enterPID /F
In Linux netstat -anp |grep 3306
kill -9 pid
- Check gradle or maven dependencies
- And here is where I get stuck.
In spring-boot, you can make the configuration set up automatically. But you need to make the files right in their places.
- xx.yml need put in resources(In IDEA, you need to specify the package as resources package)
- xxxApplication.class(The spring-boot-starter class should be out of other classes, or you should specify the other classes' path.