連接遠程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,就連接成功了。 原因好像是安全問題,具體就不知道了