Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法打开http://127.0.0.1:8080/ #121

Open
LukeLIN-web opened this issue Feb 22, 2022 · 1 comment
Open

无法打开http://127.0.0.1:8080/ #121

LukeLIN-web opened this issue Feb 22, 2022 · 1 comment

Comments

@LukeLIN-web
Copy link

Caused by: org.hibernate.exception.JDBCConnectionException: Unable to open JDBC Connection for DDL execution

Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory

@LukeLIN-web
Copy link
Author

LukeLIN-web commented Feb 22, 2022

application-docker.properties 设置为

spring.datasource.url=jdbc:mysql://mysql:3308/favorites?useUnicode=true&characterEncoding=utf-8
favorites.base.path=http://127.0.0.1:8080/
forgotpassword.url=http://127.0.0.1:8080/newPassword

application-dev.properties 设置为

spring.datasource.url=jdbc:mysql://mysql:3308/favorites?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC&useSSL=true
favorites.base.path=http://127.0.0.1:8080/
forgotpassword.url=http://127.0.0.1:8080/newPassword

docker-compose.yml设置为

  mysql:
   build: ./mysql
   environment:
     MYSQL_DATABASE: favorites
     MYSQL_ROOT_PASSWORD: root
     MYSQL_ROOT_HOST: '%'
     TZ: Asia/Shanghai
   ports:
   - "3308:3306"
   volumes:
     - ./mysql_data:/var/lib/mysql
   restart: always

@LukeLIN-web LukeLIN-web changed the title 无法启动项目. 无法打开http://127.0.0.1:8080/ Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant