错误一
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
7月 18 10:20:42 node007 setroubleshoot[24110]: SELinux is preventing /usr/sbin/mysqld from name_bind access on the tcp_socke
7月 18 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
7月 18 10:20:42 node007 systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
7月 18 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.
7月 18 10:20:42 node007 systemd[1]: Unit mysqld.service entered failed state.
7月 18 10:20:42 node007 systemd[1]: mysqld.service failed.
7月 18 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.