use mysql;
##然后查看下当前连接允许情况
select host, user, authentication_string, plugin from user;
##依次执行
CREATE USER 'root'@'%' IDENTIFIED BY 'root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
FLUSH PRIVILEGES;
##再次查看连接情况
select host, user, authentication_string, plugin from user;

windows版mysql添加远程访问

完成;

相关文章: