[异常处理]mysql8 SELinux is preventing from name_bind

错误一

1、报错关键点

SELinux is preventing /usr/sbin/mysqld from name_bind access on the tcp_socke

2、问题分析

SELinux安全机制禁止了mysql的其他端口绑定,导致无法通信。

3、问题处理

告警中已经提示semanage port -a -t PORT_TYPE -p tcp 3308

718 10:20:42 node007 setroubleshoot[24110]: SELinux is preventing /usr/sbin/mysqld from name_bind access on the tcp_socke
718 10:20:42 node007 python[24110]: SELinux is preventing /usr/sbin/mysqld from name_bind access on the tcp_socket port 3

                                              *****  Plugin bind_ports (92.2 confidence) suggests   ************************

                                              If you want to allow /usr/sbin/mysqld to bind to network port 3308
                                              Then you need to modify the port type.
                                              Do
                                              # semanage port -a -t PORT_TYPE -p tcp 3308
                                                  where PORT_TYPE is one of the following: mysqld_port_t, tram_port_t.

                                              *****  Plugin catchall_boolean (7.83 confidence) suggests   ******************

                                              If you want to allow nis to enabled
                                              Then you must tell SELinux about this by enabling the 'nis_enabled' boolean.

                                              Do
                                              setsebool -P nis_enabled 1

                                              *****  Plugin catchall (1.41 confidence) suggests   **************************

                                              If you believe that mysqld should be allowed name_bind access on the port 3308 tcp_s
                                              Then you should report this as a bug.
                                              You can generate a local policy module to allow this access.
                                              Do
                                              allow this access for now by executing:
                                              # ausearch -c 'mysqld' --raw | audit2allow -M my-mysqld
                                              # semodule -i my-mysqld.pp

718 10:20:42 node007 systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
718 10:20:42 node007 systemd[1]: Failed to start MySQL Server.
-- Subject: Unit mysqld.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysqld.service has failed.
--
-- The result is failed.
718 10:20:42 node007 systemd[1]: Unit mysqld.service entered failed state.
718 10:20:42 node007 systemd[1]: mysqld.service failed.
718 10:20:42 node007 polkitd[1113]: Unregistered Authentication Agent for unix-process:24028:7058800 (system bus name :1.

[root@node007 ~]# semanage port -a -t mysqld_port_t -p tcp 3308
[root@node007 ~]# systemctl start mysqld.service

错误二

1、错误无提示

my.cnf 配置lower_case_table_names=1导致无法启动

2、错误处理

原因:无法在my.cnf配置,只能初始化时使用该参数:–initialize --lower-case-table-names=1
处理:删除该参数

# 官方文档
lower_case_table_names can only be configured when initializing the server. Changing the lower_case_table_names setting after the server is initialized is prohibited.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值