为何mysql要用mariaDB的驱动去连接?

我的mysql数据库信息如下:

`Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16338
Server version: 5.7.25-log MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective owners.`

我的springboot工程中,配置

spring:
  datasource:
     driver-class-name: org.mariadb.jdbc.Driver
     

启动起来没有问题,但是如果改成mysql的驱动(com.mysql.cj.jdbc.Driver或者 com.mysql.jdbc.Driver),反而启动不了
怎么回事?

阅读 6.3k
2 个回答

报错无非配错/连错
直接配url就好,驱动会自动检测出来

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题