5

springboot +mybatis,配置了数据源,启动还是报错,百度,千篇一律的答案都不是我要的

已经配置了mybatis,如下:

 <environments default="development">
        <environment id="development">
            <transactionManager type="JDBC"></transactionManager>
            <dataSource type="POOLED">
                <property name="driver" value="com.mysql.jdbc.Driver"/>
                <property name="url" value="jdbc:mysql://127.0.0.1:3306/db_cloudplatform" />
                <property name="username" value="root"/>
                <property name="password" value="myc123456" />
                <!-- 初始化连接大小 -->
                <property name="initialSize" value="10" />
                <!-- 连接池最大数量 -->
                <property name="maxActive" value="60" />
                <!-- 连接池最大空闲 -->
                <property name="maxIdle" value="60" />
                <!-- 连接池最小空闲 -->
                <property name="minIdle" value="2" />
                <!-- 获取连接最大等待时间 -->
                <property name="maxWait" value="6000" />

                <!--<property name="timeBetweenEvictionRunsMillis" value="${timeBetweenEvictionRunsMillis}"/>

                <property name="minEvictableIdleTimeMillis" value="${minEvictableIdleTimeMillis}"/>

                <property name="validationQuery" value="${validationQuery}"/>-->
            </dataSource>
        </environment>
    </environments>

启动一直报错:

 Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
    If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
    If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

望高手指点

查看全部
Myc_CSDN
和Java狼狈为奸
2018/08/30 08:49
  • spring
  • mybatis
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

11个回复