mysql配置文件[mysqld]下输入
skip-grant-tables
重启服务
修改密码
use mysql;
update mysql.user set authentication_string=password('root_password') where user='root';
开启远程登录
先修改密码策略
set global validate_password_policy=0;
set global validate_password_length=1;
修改更新密码
alter user 'root'@'localhost' identified by 'root';
开启远程登录用户root密码为root登录网络为*.*任意网段
grant all privileges on *.* to 'root'@'%' identified by 'root';