MySQL8 mysql8以下版本是可以通过 grant all privileges on *.* to user@'host' identified by '密码'来授权远程登录的,但是mysql8以后这个不好使了 需要 use mysql; update user set host = '%' where user = 'root'; 然后重启mysql 然后就好用了