java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect
2016-09-15 22:44
477 查看
java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect
2014年06月29日 ⁄ 综合 ⁄ 共 637字 ⁄ 字号 小 中 大 ⁄ 评论关闭java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect to this MySQL server":
java.sql.SQLException: Access denied for user 'root'@'xxx.xxx.xxx.xxx' at (数据库名)
表示该对象不是远程对象,不能通过该对象远程访问数据
解决:
方案一:改表:
use mysql ;select user,host,password from user;
update user set host = '%' where user='root';
方案二:授权法:
例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
无论使用哪种方案,请重启Mysql服务。
http://hi.baidu.com/soutnila/item/5356f2c0002781bf0d0a7bae
相关文章推荐
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- 远程mysql_java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect to this MySQ
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- 远程mysql_java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect异常解决
- java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException:null, message from server: "Host '192.168.0.131' is not allowed to connect.
- java.sql.SQLException: null, message from server: "Host '10.11.3.67' is not allowed to connect to t
- java.sql.SQLException: null, message from server: "Host '192.168.1.101' is not allowed to connect
- 远程mysql_java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- 远程mysql_java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect
- java.sql.SQLException: null, message from server: "Host 'xxx' is not allowed to connect to this MySQL server"
- null, message from server: "Host ***" is not allowed to connect to this MySQL server"
- message from server: "Host xxx is not allowed to connect to this MySQL server的解決