当前位置:网站首页>Access denied for user ‘root‘@‘localhost‘ (using password: YES)的解决方法
Access denied for user ‘root‘@‘localhost‘ (using password: YES)的解决方法
2022-07-21 12:45:00 【缘友一世】
代码敲烂,月薪过万
前言:
在编程中,莫过于写了半天的东西,结果一运行出了一堆的BUG。
小编今天也是见识到了,一发入魂
环境简介
- IDEA2020.2
- mybatis连接数据库
错误展示
原因一:密码BUG了【本人中招】
- 密码输入错误
原因二:Mapper相关错误【一般IDEA会有提示】
<!--namespace=绑定一个对应的Dao/Mapper接口-->
<mapper namespace="com.yang.dao.UserDao">
<!--select查询语句-->
<select id="getUserList" resultType="com.yang.pojo.User">
select * from mybatis.user;
</select>
<!-- 1、在mapper.xml中namespace等于mapper接口地址 2、mapper.java接口中的方法名和mapper.xml中statement的id一致 3、mapper.java接口中的方法输入参数类型和mapper.xml中statement的parameterType指定的类型一致。 4、mapper.java接口中的方法返回值类型和mapper.xml中statement的resultType指定的类型一致。 -->
</mapper>
原因三:mybatis配置文件
<!--configuration核心配置文件-->
<configuration>
<property name="driver" value="com.mysql.cj.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/mybatis?useSSL=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC"/>
<!--每一个Mapper.xml都需要MaBatis核心配置文件中注册!-->
<mappers>
<mapper resource="com/yang/dao/UserMapper.xml"/>
</mappers>
</configuration>
终于解决了
边栏推荐
- Image text cross modal fine-grained semantic alignment confidence correction mechanism aaai2022
- MySQL view stored procedures and functions
- 2022年最新湖北建筑安全员模拟题库及答案
- Cesium loads 3D tiles data
- 【板栗糖GIS】如何批量删除多个文件夹里的同名空文件
- 基于SqlSugar的开发框架循序渐进介绍(12)-- 拆分页面模块内容为组件,实现分而治之的处理
- C语言学生成绩管理系统
- Niuke.com released a new digital logic question bank! Will it lead to more volume in fpga/ic industry this year?!!
- Number和Math类的常用方法
- 多态,抽象类,接口
猜你喜欢
Detailed explanation of the specific configuration method of FANUC robot user-defined alarm
window10系统常用操作
振华风光半导体通过注册:年营收5亿 中国电子是实控人
音视频环形缓冲区 介绍与实现
[chestnut sugar GIS] WPS -- how to fill the space in the content of the previous line
[FPGA tutorial case 33] communication case 3 - BPSK modulation signal generation based on FPGA, and its constellation is tested by MATLAB
苹果因键盘不好使赔3.4亿,SpaceX接单韦布后继者,META起诉Meta,今日更多新鲜事在此...
Sdl2 concise tutorial (III): display pictures
Let Matplotlib and Seaborn data map move ~
柠萌影视通过聆讯:年营收12亿 腾讯与芒果文创是股东
随机推荐
多态,抽象类,接口
05mysql的锁分析
岛屿数量vs最大正方形
C语言学生成绩管理系统
SDL2 简明教程(三):显示图片
Geotools learning reference article
mysql面试题整理
Anfulai embedded weekly report no. 274: 2022.07.11--2022.07.17
Subvert cognition! There are as many as 13 methods to guarantee research?
阿里云ECS手动挂载磁盘
Development direction and problems of optaplanner
让Matplotlib、Seaborn数据图动起来~
牛客网发布了全新数字逻辑题库!会不会导致今年FPGA/IC行业更卷?!!
百度/Google等搜索引擎的信息检索搜索技巧总结
[FPGA tutorial case 33] communication case 3 - BPSK modulation signal generation based on FPGA, and its constellation is tested by MATLAB
Alicloud ECS manually attaching disks
Summary of information retrieval and search skills of Baidu /google and other search engines
322. Change
July training (day 21) - heap (priority queue)
300. Longest increasing subsequence