create connection SQLException, url: jdbc:mysql//localhost:3306/jdbc, errorCode 0, state null

这是什么鬼

ERROR 1742 --- [-Create-5447981] com.alibaba.druid.pool.DruidDataSource : create connection SQLException, url: jdbc:mysql//localhost:3306/jdbc, errorCode 0, state null

java.sql.SQLException: connect error, url jdbc:mysql//localhost:3306/jdbc, driverClass com.mysql.jdbc.Driver
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1666) ~[druid-1.1.17.jar:1.1.17]
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2697) ~[druid-1.1.17.jar:1.1.17]

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </dependency>
             <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>druid</artifactId>
        <version>1.1.17</version>
    </dependency>

2个回答

jdbc:mysql://localhost:3306/jdbc,是不是mysql后边少个:号。

jdbc.url配置可能有问题,jdbc.url格式是jdbc:mysql://[host:port],[host:port].../[database][?参数名1][=参数值1][&参数名2][=参数值2]...,
把jdbc:mysql//localhost:3306/jdbc改成

jdbc:mysql://localhost:3306/jdbc

还有确认下jdbc有这个数据库吗?

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!