报错信息
远程连接MySQL报错:java.sql.SQLException: null, message from server: "Host '192.168.170.1' is not allowed to connect to this MySQL server"
报错原因
因为没有启动远程访问权限导致的,只需要开启远程访问权限就可以了
报错解决
进入MySQL开启远程服务
进入mysql数据库
update user set host = '%' where user = 'root';
再重启MySQL服务使其生效
service mysqld restart