参考文章
https://www.cnblogs.com/net5x/articles/9330996.html
https://blog.csdn.net/weixin_34348805/article/details/91895879
https://www.cnblogs.com/xiii/p/4890885.html
https://blog.csdn.net/weixin_30466421/article/details/95056486
https://blog.csdn.net/luolan_hust/article/details/89710954

打开MySQL命令行
image.png
依次运行下列命令

  1. use mysql;
  2. grant all privileges on *.* to 'root'@'%' identified by 'lgh19890717' with grant option;
  3. flush privileges;

mysql8.0其他机器访问_MySQL8.0允许外部访问

https://blog.csdn.net/weixin_39569051/article/details/111743010