oddfar / campus-imaotai

i茅台app自动预约,每日自动预约,支持docker一键部署(本项目不提供成品,使用的是已淘汰的算法)
https://oddfar.github.io/campus-doc/campus-imaotai
Apache License 2.0
4.11k stars 1.35k forks source link

[bug]: 镜像是不是有问题了,连不上mysql #286

Open sclodestar opened 8 months ago

sclodestar commented 8 months ago

请确保您已阅读以上注意事项,并勾选下方的确认框。

campus框架版本

No response

本项目 campus-imaotai 版本

1.0.12

运行环境

Windows (64)

运行架构

Centos7.9

问题描述

之前从1.0.8一路升级过来到1.0.11都正常,基本操作没有难度

今天更新1.0.12提示mysql无法连接,降级到1.0.11也不行,是不是拉取的镜像的mysql配置不对?

mysql本地测试无异常。

期望的结果是什么?

请大神修正一下

错误代码(部分)

campus-server | Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'IUserMapper' defined in URL [jar:file:/home/campus/campus.jar!/BOOT-INF/classes!/com/oddfar/campus/business/mapper/IUserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/baomidou/dynamic/datasource/spring/boot/autoconfigure/DynamicDataSourceAutoConfiguration.class]: Invocation of init method failed; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

campus-server | Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

campus-server | Caused by: java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

campus-server | Caused by: java.net.ConnectException: Connection refused (Connection refused)



### 日志记录(可选)

_No response_

### 补充说明(可选)

_No response_
gadore commented 8 months ago

上午刚弄的,现在已经部署好了,明天上午准备预约抢,所以我觉得镜像应该没问题,哈哈哈

sclodestar commented 8 months ago

奇怪了,正常升级操作,重新启动campus-server后就提示mysql无法连接

这个连接的配置文件在哪里呢?我改一下也可以。

oddfar commented 8 months ago

不行就重新部署吧,把sql备份一下

luoxufeiyan commented 8 months ago

Docker 部署之后需要手动导入一下表结构 https://github.com/oddfar/campus-imaotai/issues/118#issuecomment-1871007128