在配置类重写jdbcProperties方法
// 数据源,必配,用的是阿里巴巴的 druid数据源,其他属性可自行查阅
@Override
public List<Properties> jdbcProperties() {
List<Properties> list = new ArrayList<Properties>();
Properties properties = new Properties();
properties.put("name","dataSource");
properties.put("url","jdbc:mysql://10.211.55.15:3306/mars?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8");
properties.put("username","root");
properties.put("password","Root123456!");
properties.put("driverClassName","com.mysql.jdbc.Driver");
list.add(properties);
// 如果要多个数据源,add多个到list即可
return list;
}