grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘123456‘ with grant option;
flush privileges;
貌似在mysql8中会发生错误
Duplicate entry ‘%-root‘ for key ‘PRIMARY‘ 在通过修改user表配置远程连接时遇到的错误
原因是表中有一条数据已经被修改为了%
原文:https://www.cnblogs.com/lianghexiang/p/14932190.html