广告
返回顶部
首页 > 资讯 > 数据库 >解决无法引入 mysql-connector-j 的问题
  • 858
分享到

解决无法引入 mysql-connector-j 的问题

springmavenintellij-idea 2023-10-12 11:10:12 858人浏览 泡泡鱼
摘要

开发环境 windows 10oracle jdk 1.8Maven 3.8.8IntelliJ idea 2022.2.2 问题 在使用 spring initializr 创建 Spring Boot 项目时,无法引入 Mysql-c

开发环境

问题

在使用 spring initializr 创建 Spring Boot 项目时,无法引入 Mysql-connector-j 这个依赖,报错信息:

com.mysql:mysql-connector-j:jar:unknown was not found in https://maven.aliyun.com/repository/public during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of aliyunmaven has elapsed or updates are forced

pom.xml 文件

// 父依赖    org.springframework.boot    spring-boot-starter-parent    2.5.14                 org.springframework.boot        spring-boot-starter-WEB                org.springframework.boot        spring-boot-starter-test        test                com.mysql        mysql-connector-j        8.0.32        runtime                com.baomidou        mybatis-plus-boot-starter        3.5.3.1    

原因

我使用的 Spring Boot 版本为 2.5.14,该版本使用的 mysql-connector-j 版本为 8.0.29,同时我的依赖是从阿里云的镜像库而不是 Maven 的中央仓库上下载的。我尝试手动引入这个版本。

    com.mysql    mysql-connector-j    8.0.29    runtime

结果报了同样的错误。也就是说,阿里云镜像仓库可能没有这个版本的 mysql-connector-j

解决方法

手动引入高于 8.0.29 版本的 mysql-connector-j 即可解决。

    com.mysql    mysql-connector-j    8.0.32    runtime

来源地址:https://blog.csdn.net/qq_41834086/article/details/132241656

您可能感兴趣的文档:

--结束END--

本文标题: 解决无法引入 mysql-connector-j 的问题

本文链接: https://www.lsjlt.com/news/429303.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作