关于用jdbc访问云数据库mysql Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES)问题
2017-10-19 11:04
477 查看
这个问题表示云服务器上的数据库没有给“xxx.xxx.xxx.xxx”用户访问权限,这时候我们需要进入mysql为用户赋权限:
执行授权命令
mysql> grant all privileges on *.* to root@'%' identified by '123';
Query OK, 0 rows affected (0.07 sec)
上述代码表示给用户名为root的所有用户操作数据库的所有权限
代码这里需要对应上去Connection conn = DriverManager.getConnection(url, "root", "123");
此时我们再尝试访问数据库就成功了
此时我们再尝试访问数据库
执行授权命令
mysql> grant all privileges on *.* to root@'%' identified by '123';
Query OK, 0 rows affected (0.07 sec)
上述代码表示给用户名为root的所有用户操作数据库的所有权限
代码这里需要对应上去Connection conn = DriverManager.getConnection(url, "root", "123");
此时我们再尝试访问数据库就成功了
此时我们再尝试访问数据库
相关文章推荐
- 【mysql】关于mysql拒绝访问错误:Access denied for user 'root'@'localhost' (using password:YES)
- MYSQL问题解决方案:Access denied for user 'root'@'localhost' (using password:YES)
- mysql启动问题access denied for user 'root'@'localhost'(using password:YES)
- 关于jdbc.properties(Access denied for user 'root '@'localhost' (using password: Yes))
- 关于MySql登录出现错误代码 1045 Access denied for user 'root'@'localhost' (using password:YES)
- mysql启动问题access denied for user 'root'@'localhost'(using password:YES)
- MYSQL问题解决方案:Access denied for user 'root'@'localhost' (using password:YES)
- mysql 安装问题 access denied for user 'root'@'localhost' using password yes/no
- 关于java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)问题解决
- MySQL登录时出现 Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES) 的原因及解决办法
- 关于mysql 的错误:Access denied for user 'root'@'101.81.76.97' (using password: YES)
- mysql启动问题access denied for user 'root'@'localhost'(using password:YES)
- MYSQL问题解决方案:Access denied for user 'root'@'localhost' (using password:YES)
- MySQL问题:Access denied for user 'root'@'localhost' (using password: YES)
- MySql 出现ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).问题解决方案
- wampserver登陆mysql出现#1045 - Access denied for user 'root'@'localhost' (using password: YES) 问题
- MYSQL问题解决方案:Access denied for user 'root'@'localhost' (using password:YES)
- MYSQL问题解决方案:Access denied for user 'root'@'localhost' (using password:YES)
- MYSQL问题解决方案:Access denied for user 'root'@'localhost' (using password:YES)
- Navicat for Mysql建立本地连接出现 1045 -Access denied for user'root'@'ipAddress'(using password :yes) 的问题