use mysql;

select host,user from user;

wKioL1axqVHBtbXFAAAf7GXl5tE051.png

由此可见root没有远程连接权限

 Grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option;

(%表示是所有的外部机器,如果指定某一台机,就将%改为相应的机器名;‘root’则是指要使用的用户名,)