use mysql #进入用户库
#查看用户权限
select * from user\G; #因为数据太多,所以改成竖行显示\G
这里的priv是privilege:特权
#查询指定的数据
select host,user,authentication_string from user;
看到都是localhost本地连接
创建远程用户
set global validate_password_policy=0;
create user 用户名 identified by '密码大于8位'
一般%都是指定的ip
远程连接
systemctl start firewalld#开启防火墙
systemctl status firewalld#查看状态
firewall-cmd --zone=public --add-port=3306/tcp --permanent #开放端口
firewall-cmd --reload#重启
权限不够只能看见一个库
授予权限
一般是运维人员管理
grant all privileges on *.* to 用户名@'%' identified by '密码'