mysql_secure_installation 按回车
Enter current password for root (enter for none): 按回车
Set root password? [Y/n] y 设置root账号密码
New password:输入新密码
Re-enter new password:再次输入
Remove anonymous users? [Y/n] Y 删除匿名用户
Disallow root login remotely? [Y/n] n 禁止远程登录
Remove test database and access to it? [Y/n] n 删除test数据库
Reload privilege tables now? [Y/n] y 刷新权限
7.关闭防火墙
systemctl stop firewalld.service
8.授权远程访问
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY 'root' WITH GRANT OPTION;