Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project springboot-mybatis-demo: Access denied for user 'root'@'localhost' (using password:


作为新手自学mybaits采坑集1:Access denied for user 'root'@'localhost' (using password: YES) -> [Help 1]

        关于在使用mybatis的generator插件自动导入实体类时,找个网上的教材,照着教材一顿papapa的敲完。

1、插件写入pom.xml

2、写generatorConfig.xml

3、edit configrations

4、启动

端起杯子抱着静静,准备等实体类的自动生成。得!

[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project springboot-mybatis-demo: Access denied for user 'root'@'localhost' (using password: YES)

百思不得姐啊,锅们儿!去github上找到源码,拉下来一顿跑。gg,还是一样!项目的问题还是mysql的问题,我也不知道啊。来吧,搞起。卸载mysql,在装回来,不设密码,结果还是一样还是一样。我就奇了怪了,别人的项目都能跑好,我的就不行了,难道是我的坐姿不对?进入apache的官网一看:MojoExecutionException

Unlike many other errors, this exception is not generated by the Maven core itself but by a plugin. As a rule of thumb, plugins use this error to signal a problem in their configuration or the information they retrieved from the POM.

乖乖!以上大致内容说这个异常不是由Maven核心本身生成的,而是由一个插件生成的。其间再次浏览诸多网站不得解。最后得一大神帮助。总结解决方案如下:


        1、在mysql的安装目录下:mysql->dataDiector下,找到my.ini文件,在文件末尾加上:skip-grant-tables,然后保存并关闭文件

        2、重新启动MySQL服务,小白注意了,是重新启动MySQL服务,并不是启动安装的SQLyog。

重启方法:{WIN+R,输入services.msc

Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project springboot-mybatis-demo: Access denied for user 'root'@'localhost' (using password:_第1张图片

;找到你的mysql服务

Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project springboot-mybatis-demo: Access denied for user 'root'@'localhost' (using password:_第2张图片

;重启动此服务}

        3、在命令行中输入“mysql -uroot -p”(不输入密码),回车即可进入数据库。小白注意了,如果没有配置mysql的环境变量,那就请先配置mysql的环境变量

        4、执行“use mysql”,接着“update user set authentication_string=password('123456') ”,就是修改root的密码

        5、在回到IDEA的项目中修改好spring.dataSource.username=root&&password=123456即可

大功告成,继续撸代码!

你可能感兴趣的:(Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project springboot-mybatis-demo: Access denied for user 'root'@'localhost' (using password:)