Caused by: java.sql.SQLException: Access denied for user 'root'@'host' (using password: YES)
2018-03-26 15:46
459 查看
解决办法: 1. SELECT * FROM mysql.user WHERE USER='root'; 2. GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.107.61' IDENTIFIED BY 'root'; 3. FLUSH PRIVILEGES;
解决后的截图:
错误的具体现象:
1,开发同学都可以在自己电脑上连接测试服务器上的数据库
2,在服务器上通过命令mysql -uroot -proot可以连上数据库,但是通过mysql -uroot -proot -h192.168.107.61(服务器ip)连不上
3,程序sql日志,查询可以正常输出,更新就会报超时,然后报这个错误。执行完解决办法的sql后,问题解决。不需要重新mysql和tomcat服务。
实在没理解为什么查询可以打印查询结果,更新报错。重新授权后,更新就可以了。同样的数据,同样的代码。
转载自>https://blog.csdn.net/zl544434558/article/details/54317696
解决后的截图:
错误的具体现象:
1,开发同学都可以在自己电脑上连接测试服务器上的数据库
2,在服务器上通过命令mysql -uroot -proot可以连上数据库,但是通过mysql -uroot -proot -h192.168.107.61(服务器ip)连不上
3,程序sql日志,查询可以正常输出,更新就会报超时,然后报这个错误。执行完解决办法的sql后,问题解决。不需要重新mysql和tomcat服务。
实在没理解为什么查询可以打印查询结果,更新报错。重新授权后,更新就可以了。同样的数据,同样的代码。
转载自>https://blog.csdn.net/zl544434558/article/details/54317696
相关文章推荐
- Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)
- Caused by: java.sql.SQLException: Access denied for user 'root'@'host' (using password: YES)
- java.sql.SQLException: Access denied for user 'ROOT'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)问题
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
- 错误java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)的一种解决方法
- Java_bug收集_java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'root'@'10.10.10.10' (using password: YES)
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)错误原因
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password:YES)错误
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)