1.登上你的mysql数据库
mysql -uroot
2.给mysql加IP访问权限(IP地址改成你的)
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.217.171'
3.查看加权限是否成功
show grants for 'root'@'192.168.217.171'