java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:871)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1714)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1224)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2190)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2221)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2016)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:776)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.baomidou.mybatisplus.generator.config.DataSourceConfig.getConn(DataSourceConfig.java:191)
at com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder.handlerDataSource(ConfigBuilder.java:269)
at com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder.<init>(ConfigBuilder.java:132)
at com.baomidou.mybatisplus.generator.AutoGenerator.execute(AutoGenerator.java:92)
at com.nums.industry5.MyGenerator.main(MyGenerator.java:135)
Exception in thread "main" java.lang.NullPointerException
at com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder.getTablesInfo(ConfigBuilder.java:457)
at com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder.handlerStrategy(ConfigBuilder.java:281)
at com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder.<init>(ConfigBuilder.java:142)
at com.baomidou.mybatisplus.generator.AutoGenerator.execute(AutoGenerator.java:92)
at com.nums.industry5.MyGenerator.main(MyGenerator.java:135)

这是在运行代码的过程中将一个sql语句执行错误,然后自己失去了登录权限.

当时解决这个bug也是找了挺多的地方的.

后来发现只有这种方法是最好的:

打开你安装mysql数据库的地方,然后在my.ini这个文件中最后一行配置上这句话,

skip-grant-tables

然后将mysql这个服务进行重新启动.通过我的电脑--->管理---->服务---->>>找到mysql,进行重新启动.然后再重新进行登录就可以登录.

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)解决方案的更多相关文章

  1. java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)

    在更新项目之后,做了一定的改动后发现竟然报错了,刚才还好好的. java.sql.SQLException: Access denied for user 'root'@'localhost' (us ...

  2. 技术笔记1:java.sql.SQLException: Access denied for user 'root'@'localhost' (using password)

    在myEclipse10中运行java项目的时候,遇到java.sql.SQLException: Access denied for user 'root'@'localhost' (using p ...

  3. java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) 解决办法

    一.背景 在Spark中,将DStream写入到MySQL出现错误:java.sql.SQLException: Access denied for user 'root'@'localhost' ( ...

  4. [Spring MVC - 2A] - java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

    严重: Servlet.service() for servlet [springMVC] in context with path [/ExceptionManageSystem] threw ex ...

  5. 数据库异常 :java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

    最近在新项目中突然出现了  java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) ...

  6. Eclipse使用jdbc连接MySql数据库报:java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

    在使用eclipse连接mysql数据库时报异常: java.sql.SQLException: Access denied for user 'root'@'localhost' (using pa ...

  7. java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

    :: - [localhost-startStop-] INFO - Root WebApplicationContext: initialization started -- :: - [local ...

  8. java.sql.SQLException: Access denied for user 'root '@'localhost' (using password: YES) 最蠢

    我犯了七年前的错误,一个空格,昨天就想到的,还对比了一下密码有没有空格 问题原因1:多写空格 在datasource.properties 中的username 的值root后面多写了一个空格, jd ...

  9. java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)报错

    今天用spring整合mybatis的时候,报了这个错误.去网上查了一下,网上大多数都是用户权限问题,但是我用SQLyog视图使用root用户crud没有问题,排除了是权限的问题,后面发现是idea提 ...

随机推荐

  1. php面向对象(目录操作)

    目录操作 创建目录 Mkdir(目录地址,权限,是否递归创建=false); Rmdir(目录地址) 删除目录 仅仅可以删除空目录.(不支持递归删除) 移动(改名) Rename(旧地址,新地址) 该 ...

  2. ROS初探--意义、基本模块

    顾虑就使我们都变成了懦夫,使得那果断的本色蒙上了一层思虑的惨白的容颜,本来可以做出伟大的事业,由于思虑就化为乌有了,丧失了行动的能力.-----哈姆雷特 ROS: Robot Operating Sy ...

  3. linux的fcntl函数

    fcntl可实现对指定文件描述符的各种操作,例如获取/设置 文件的是否可以被读写的状态,等其他状态. int fcntl (int __fd, int __cmd, ...);The remainin ...

  4. use azure-cli to manage resources

    登陆 注意: 在Azure China中使用Azure CLI 2.0之前,请首先切换环境, 运行: az cloud set -n AzureChinaCloud 如果想切回全球的版本: az cl ...

  5. matlab中执行mex文件时提示GLIBCXX not found

    解决方案参考: http://stackoverflow.com/questions/8421708/glibcxx-not-found-when-compiling-vtk-example-unde ...

  6. [ES] - 图形化界面工具

    推荐更新: Windows平台为 ElasticSearch 6.x 安装 Head 客户端插件 elasticsearch-head A web front end for an Elasticse ...

  7. todo...git ssh http的区别

    todo...git ssh http的区别 https://www.jianshu.com/p/2cced982009f https://www.cnblogs.com/skating/p/6296 ...

  8. java多线程中篇(一) —— Thread详情

    简介 简言之,现在的JDK线程模型基于操作系统原生线程,所以模型依赖于操作系统对线程的支持,另外Windows和Linux系统提供的线程模型就是一对一的 所以可以简单认为: 现在Java线程与操作系统 ...

  9. Springboot对JPA的支持及使用

    目的: 1.springboot之jpa支持 2.Springboot+bootstrap界面版之增删改查及图片上传 springboot之jpa支持 导入相关pom依赖 <dependency ...

  10. Asp.net Identity 修改默认数据库,增加自定义字段

    visual studio 2013 先新建一个项目 选择MVC,确定 打开 Views\Shared\_Layout.cshtml文件,按自己的要求修改 改 <!DOCTYPE html> ...