<mappers>
<mapper resource="com/sz/mapper/GirlMapper.xml"/>
</mappers>
改为
<mappers>
<mapper resource="com.sz.mapper/GirlMapper.xml"/>
</mappers>
配制如下
<environments default="dev">
<environment id="dev">
<transactionManager type="JDBC"></transactionManager>
<dataSource type="UNPOOLED">
<property name="driver" value="com.mysql.cj.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/mybatis?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT"/>
<property name="username" value="root"/>
<property name="password" value="root123"/>
</dataSource>
</environment>
</environments>
mysql8.0中有时区的差别,故要添加上serverTimezone=GMT
由于idea将&当做特殊字符,故使用&代替