1、创建配置文件,application.yaml
    image.png

    2、在配置文件中配置:

    1. # 服务端口
    2. server:
    3. port: 8001
    4. # 服务名
    5. spring:
    6. application:
    7. name: service-edu
    8. # 环境设置:dev、test、prod
    9. profiles:
    10. active: dev
    11. # mysql数据库连接
    12. datasource:
    13. driver-class-name: com.mysql.cj.jdbc.Driver
    14. url: jdbc:mysql://localhost:3306/guli?serverTimezone=GMT%2B8
    15. username: root
    16. password: 941941
    17. #mybatis日志
    18. mybatis-plus:
    19. configuration:
    20. log-impl: org.apache.ibatis.logging.stdout.StdOutImpl