java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect异常解决
来源:互联网 发布:js音乐播放器插件 编辑:程序博客网 时间:2024/06/05 04:00
表示不能被允许远程访问,ip地址必须是localhost或者127.0.0.1,就算是局域网内也不行。
出现此异常的原因一般是在迁移项目后,只要你项目的数据库配置文件下的ip不是localhost或者127.0.0.1,就会出现此错误。
所以允许任何主机访问数据库就行了。
管理员打开cmd -->进入mysql
mysql -u root -p
root
use mysql
select host from user;
update user set host='%' where user='root';
exit #退出mysql
net stop mysql57 #停止mysql57服务,注意:mysql57改成你机器的mysql服务
net start mysql7 #启动服务,windows好像没有重启restart命令,只能停止后启动,反正我没找到。
例如,你想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;
阅读全文
0 0
- 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
- 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
- 远程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 MySQ
- 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 '27,45,38,132' is not allowed to connect
- message from server: "Host 'xxx' is not allowed to connect to this MySQL server的解决
- mysql message from server: "Host 'xxx' is not allowed to connect to this MySQL server的解决
- message from server: "Host 'xxx' is not allowed to connect to this MySQL server"
- MySQL:message from server: "Host xxx is not allowed to connect to this MySQL server"
- ./configure,make,make install的作用
- PL/SQL 创建
- LaTeX笔记--一些常用的数学符号
- Java-死磕算法-排序-冒泡排序
- 类---C++ 基础
- java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect异常解决
- 淘淘商城系列——商品搜索功能测试
- 使用bundle exec强制限定使用本项目Gemfile指定的rake执行命令
- Linux-鸟菜-6-文件与目录的 默认权限、隐藏权、特殊权限
- Android ADB工具 adb,adbd,client,server之间的关系
- unity 3D入门
- 大数据-十二
- 列表浅谈,字符串补充
- Ffmpeg源代码简单分析之解码1