1、报错内容:Cannot create JDBC driver of class 'com.mysql.jdbc.Driver' for connect URL 'jdbc:mysql//localhost:3305/express?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true'
后面认真检查原来是Database URL写错了
正确的写法应该是jdbc:mysql://localhost:3305/express?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true
我写成了jdbc:mysql//localhost:3305/express?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true少了个冒号hhh
2、如果报错内容是:
Cannot create PoolableConnectionFactory (Communications link failure
Last packet sent to the server was 0 ms ago.)
那就说明你获取的数据库所在的主机地址写错了,因为我获取的本机的数据库,所以我应该写的是localhost或者127.0.0.1