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]‘%‘ identified by ‘root‘

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

时间: 2024-10-23 08:38:32

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

连接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的已经开启权限,

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'

程序在连接远程 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呢. +-----------------------+

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

出错原因: 连接数据库是忘记配username 和 password 了 刚在学hiberbate4,把持久层从纯粹的jdbc改为hiberbate 出现的错误.(原来的是直接读取properties) 解决方法就是在hibernate.cfg.xml加上最后两行(当然其他的也必不可少) 1 <property name="connection.url">jdbc:mysql://localhost:3306/sm</property> 2 <proper

[Spring MVC - 2A] - java.sql.SQLException: Access denied for user &#39;root&#39;@&#39;localhost&#39; (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 &#39;root&#39;@&#39;localhost&#39; (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 &#39;root&#39;@&#39;localhost&#39; (using password: NO)

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

java.sql.SQLException: Access denied for user &#39;root&#39;@&#39;d001&#39; (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

错误:java.sql.SQLException: Access denied for user &#39;&#39;@&#39;localhost&#39; (using password: NO)

详细错误: 1 java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO) 2 at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.17.jar:8.0.17] 3 at com.mysql.cj.jdbc.exceptions.SQL