linux的centos7的数据库连接本地navi cat需要注意的

来源:互联网 发布:程序员找工作最佳月份 编辑:程序博客网 时间:2024/05/22 12:47

注意点一,Centos7中防火墙变为了firewall

1 查看防火墙状态

[root@centos01 ~]# firewall-cmd --state

running

2 果然是运行的,于是就想disabled防火墙服务

[root@centos01 ~]# systemctl mask firewalld

ln -s '/dev/null' '/etc/systemd/system/firewalld.service'

3 然后关闭防火墙

[root@centos01 ~]# systemctl stop firewalld

4 最后检查防火墙服务,发现已经关闭了

[root@centos01 ~]# firewall-cmd --state

not running

然后Ambari服务就正常工作了

注意点二,需要centos7中的mysql数据库授权

1、(如何解决客户端与服务器端的连接(mysql) :xxx.xxx.xxx.xxx is not allowed to connect to this mysql serv 
) 授权法。例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。

 代码如下复制代码GRANT ALL PRIVILEGES ON *.* TO ‘myuser’@'%’ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION;

如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码

 代码如下复制代码GRANT ALL PRIVILEGES ON *.* TO ‘root’@’192.168.1.3′ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO ‘root’@’10.10.40.54′ IDENTIFIED BY ’123456′ WITH GRANT OPTION;
1 0
原创粉丝点击