解决
mysql 5
grant all privileges on *.* to root@"%" identified by "Passwd"
mysql 8
// 8.0.11 版本之后移除了grant 语句添加用户的功能
// 也就是说 grant... 只能适用于已存在的账户
mysql> create user 'root'@'%' identified by '密码';
Query OK, 0 rows affected (2.35 sec)
mysql> grant all privileges on *.* to 'root'@'%';
Query OK, 0 rows affected (0.06 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.06 sec)
网友评论