use mysql;update user sethost='%' where host='localhost' and user='root';flush privileges;# 修改密码ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';flush privileges;#设置允许远程访问GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION;flush privileges;