解决 javasql.null, message from server: “Host ‘‘ is not allowed to connect to this MySQL server“

解决办法:

1.打开cmd,进入mysql

mysql -u root -p

2.查看root用户的信息

use mysql;

select user,host from user;

3.修改root用户的被限制的ip范围,改为不限制,及允许所有ip访问

update user set host='%' where user='root';

ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' 不予理会

直接刷新就行:就可以连接数据库了

 flush privileges;//刷新权限

猜你喜欢

转载自blog.csdn.net/Relievedz/article/details/129158037
今日推荐