连接远程MySQL数据库项目启动时,不报错但是卡住不继续启动的,

时间:2022-12-30 04:33:39

连接远程MySQL数据库项目启动时,不报错但是卡住不继续启动的,

2018-03-12 17:08:52.532DEBUG[localhost-startStop-1]o.s.beans.factory.support.DefaultListableBeanFactory.doGetBean():251 -Returning cached instance of singleton bean ‘org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0’ 
2018-03-12 17:08:52.533DEBUG[localhost-startStop-1]o.s.beans.factory.support.DefaultListableBeanFactory.doGetBean():251 -Returning cached instance of singleton bean ‘processEngine’ 
2018-03-12 17:08:53.812DEBUG[localhost-startStop-1]org.activiti.spring.SpringTransactionInterceptor.execute():40 -Running command with propagation NOT_SUPPORTED 
2018-03-12 17:08:53.825DEBUG[localhost-startStop-1]org.apache.ibatis.transaction.managed.ManagedTransaction.openConnection():85 -Opening JDBC Connection 
2018-03-12 17:08:53.834DEBUG[localhost-startStop-1]org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection():110 -Fetching JDBC Connection from DataSource 
log4j:WARN No appenders could be found for logger (com.alibaba.druid.pool.vendor.MySqlValidConnectionChecker). 
log4j:WARN Please initialize the log4j system properly. 
2018-03-12 17:08:54.193DEBUG[localhost-startStop-1]o.s.jdbc.datasource.DataSourceTransactionManager.getTransaction():367 -Creating new transaction with name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT

连接本地MySQL数据库也是。而且过一段时间,Navicat连接数据库就报“no password”无法连接。后面发现数据库用户除了创建的用户还多了一个 用户名@% 的东西(正常用户名是 用户名@)。删除多出的用户名,连接本地可以启动成功,但是远程数据库还是不行,走过路过给个提示 
找到原因 
在访问数据时连接数据库的url的问题

jdbc.url=jdbc:mysql://114.55.***.84:3306/dmdb?characterEncoding=utf8&useSSL=true
  • 1

就是“useSSL=true”搞的鬼,把true改为false,就连接成功了。 原因好像是安全问题,具体就不知道了