参考:https://jingyan.baidu.com/article/9c69d48f7155b353c9024e84.html
查询用户 host = localhost 代表没开,%为开启
select host,user from mysql.user;
root用户开启
update mysql.user set host = '%' where user = 'root';
多个root用户可能导致报错,需要再加精准条件指定某一条
|
ERROR 1062 (23000)
https://blog.csdn.net/yuanhong55/article/details/75000208
ERROR 1396 (HY000)
https://blog.csdn.net/weixin_34408624/article/details/85092741
授权(第一次出错,可以执行第二次看看)
grant ALL on *.* to `root`@`%` with grant option;
刷新
flush privileges;