铺垫:
- [root@localhost log]# getenforce 查看selinux的状态
Enforcing --》强制执行的 - [root@localhost log]# setenforce 0 临时关闭selinux
- [root@localhost log]# getenforce
Permissive 表示selinux已经不在限制访问 - [root@localhost log]# service firewalld stop 关闭firewalld服务
Redirecting to /bin/systemctl stop firewalld.service
去新建一个可以远程登录到MySQL里的用户:
alias loginmysql=‘mysql -uroot -p"123#"’
[root@localhost log]# mysql -uroot -p’123#’
授权
mysql> grant all on *.* to 'fairy'@'192.168.139.1' identified by '123456#';
1.grant 是授权的命令
2.all 代表所有的权利,