windows 访问 CentOS 的防火墙及其 网关开放

1.防火墙开放端口

firewall-cmd --zone=public --add-port=8848/tcp --permanent

 

firewall-cmd --list-ports

 

 

 

 

开放centOS 网关,远程连接

grant all privileges on *.* to 'root'@'192.168.128.1' identified by 'root' with grant option;

 

 

开放docker容器网关,使得运行的docker连接linux数据库mysql

grant all privileges on *.* to 'root'@'172.17.0.1' identified by 'root' with grant option;

 

开放所有端口远程连接mysql

 grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;

 

mysql赋权操作:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
  • 1

flush privileges;
GRANT:赋权命令
ALL PRIVILEGES:当前用户的所有权限
ON:介词
*.*:当前用户对所有数据库和表的相应操作权限
TO:介词
‘root’@’%’:权限赋给root用户,所有ip都能连接
IDENTIFIED BY ‘123456’:连接时输入密码,密码为123456
WITH GRANT OPTION:允许级联赋权

20200901:
将GRANT语句通过代码块包起来

 

posted @ 2021-02-16 16:03  abcdefghijklmnop  阅读(73)  评论(0编辑  收藏  举报