2
respostas

Config do mysql

Config

server.port: 8090
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=${FORUM_DATABASE_URL}
spring.datasource.username=${FORUM_DATABASE_USERNAME}
spring.datasource.password=${FORUM_DATABASE_PASSWORD}
spring.datasource.driver-class-name = com.mysql.jdbc.Driver
secret = 123456
forum.jwt.secret: 123456
forum.jwt.expiration: 86400000

org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

2 respostas

Oi Julio,

Você configurou as variáveis de ambiente ${FORUM_DATABASE_URL}, ${FORUM_DATABASE_USERNAME} e ${FORUM_DATABASE_PASSWORD} na IDE?

Olá fiz

export FORUM_DATABASE_URL=jdbc:mysql://localhost:3306/apispringforumalura export FORUM_DATABASE_USERNAME=root export FORUM_DATABASE_PASSWORD=senha export FORUM_JWT_SECRET=123456

então tbm queria coloca no aquivo .env tem alguma solução para isso