java.sql.SQLException: Access denied for user 'root'

程序在连接远程 mysql服务器时出错 java.sql.SQLException: Access denied for user ‘root‘@‘192.168.27.129‘ (using password: YES)

本机IP为‘192.168.27.129‘

进入mysql命令行:

MySQL>use mysql;

MySQL>select host,user from user;

查看得信息如下,也没有限制不让本机连接mysql呢。

+-----------------------+------+
| host                  | user |
+-----------------------+------+
| %                     | root |
| 127.0.0.1             | root |
| ::1                   | root |
| localhost             | root |
| localhost.localdomain | root |
+-----------------------+------+

难道是默认不让root远程登陆??

MySQL>GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘xuxu‘ WITH GRANT OPTION

予任何主机访问数据的权限

3、MySQL>FLUSH PRIVILEGES

程序再用root和密码 ,登录,结果成功!

java.sql.SQLException: Access denied for user 'root'

时间: 2024-10-11 01:37:41

java.sql.SQLException: Access denied for user 'root'的相关文章

连接mysql时提示java.sql.SQLException: Access denied for user 'root'@'DESKTOP-N2B2D9A' (using password: YES)

用root连接mysql时提示:访问被拒绝 检查一下mysql server是否开启,发现后台在运行着..  然后查了一下mysql的用户表,发现root只能运行使用本地ip(localhost或者127.0.0.1)进行连接 解决方法:新开一个权限GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'jeffw' WITH GRANT OPTION; 然后查询一下:select * from user; 新开的root的已经开启权限,

MySQL java连接被拒绝:java.sql.SQLException: Access denied for user 'root'@'****' (using password: YES)

java.sql.SQLException: Access denied for user 'root'@'***.**.**.**' (using password: YES) MySQL服务器部署在Linux上,错误中被我隐掉的是我的公网IP. 这是由于"IP为***.**.**.**,名字为root"的用户 没有权限访问数据库 解决办法: 通过Navicat连接数据库,执行下面内容: grant all privileges on *.* to [email protected]

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

1.刚开始连接数据库提示是: java.sql.SQLException: Access denied for user 'root'@'10.10.7.180' (using password: NO) 于是,我设置了root的密码:mysqladmin -u root password "newpwd". 注:shell> mysqladmin -u root -h host_name password "newpwd"password后面的双引号不是必须

使用mybatis生成相关文件时java.sql.SQLException: Access denied for user 'root'@'localhost' (using password)

问题:使用mybatis生成相关文件时,dos显示java.sql.SQLException: Access denied for user 'root'@'localhost' (using password) 解决方式:1,先检查数据库的配置文件密码是否错误, 2,检查mybatis-generator.xml的密码是否与数据库的密码相等,因为这个文件的密码不会影响到后台的数据,所以最容易被忽略,造成后台数据可以正常读取,而mybatis却不能生成相关的文件. 使用mybatis生成相关文件

[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 exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.Pe

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

各种错误一大堆啊,走了一个又来一个,继续吧 java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985) 

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

在更新项目之后,做了一定的改动后发现竟然报错了,刚才还好好的. java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO) 之后就是各种找原因.中文的关于no的这个方面资料还是比较少的.我是在一个日本的网站上看到了一些资料(不要问我为什么不goole,网限制). 总结一下吧. 1.首先去dos命令下去验证在不输入密码的情况下能不能直接登陆到mysql中 步骤:找到mysql的安装目录,

Caused by: java.sql.SQLException: Access denied for user 'root'@'192.168.6.131' (using password: YES),远程连接数据库,连接不上解决方案

进入 mysql   ; use mysql; 然后 执行 GRANT ALL PRIVILEGES ON *.* TO [email protected]"你.的.端.口" IDENTIFIED BY "你的密码" WITH GRANT OPTION; FLUSH PRIVILEGES; 然后成功 Caused by: java.sql.SQLException: Access denied for user 'root'@'192.168.6.131' (usi

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

在安装CDH的时候报错了: [email protected]:/var/cache/yum/x86_64/7/base# /opt/cm-5.13.0/share/cmf/schema/scm_prepare_database.sh mysql cdh -hd001 -uroot -proot -pwordemotion --scm-host d001 root root --force JAVA_HOME=/soft/jdk1.8.0_144 Verifying that we can wr