第一步:登录mysql # mysql -u root -p # use mysql; # select host,user from user; 第二步:修改连接 # update user set host='%' where user='root'; # ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '密码';