进入 mysql 数据库
use mysql;
修改权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; // root 是账号名称,可以在这里修改自己的账号名,password是该账号的密码
更新权限
flush privileges;
验证是否成功
select host,user from user;
use mysql;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; // root 是账号名称,可以在这里修改自己的账号名,password是该账号的密码
flush privileges;
select host,user from user;