grant all privileges on . to root@'%' identified by '123';
root: 用户名
123: 在Linux操作系统中安装的mysql密码

如果远程连接不上
1.查看防火墙是否关闭
systemctl list-unit-files | firewalld
(关闭防火墙) systemctl stop firewalld
(开机不启动防火墙) systemctl disable firewalld
2.还不行就重启mysql服务
service mysql restart
3.还不行就重启系统
reboot

posted on 2021-04-06 22:34  文种玉  阅读(77)  评论(0编辑  收藏  举报