mysql迁移数据后启动报错问题
报错日志:
2022-04-18T07:20:25.022069Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2022-04-18T07:20:25.022073Z 0 [ERROR] InnoDB: Could not find a valid tablespace file for `img_server_test/t_ldap_org`. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2022-04-18T07:20:25.022077Z 0 [Warning] InnoDB: Ignoring tablespace `img_server_test/t_ldap_org` because it could not be opened.
2022-04-18T07:20:25.022089Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2022-04-18T07:20:25.150292Z 0 [ERROR] /usr/sbin/mysqld: Can't find file: './mysql/user.frm' (errno: 13 - Permission denied)
2022-04-18T07:20:25.150299Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/user.frm' (errno: 13 - Permission denied)
2022-04-18T07:20:25.150309Z 0 [ERROR] Fatal error: Failed to initialize ACL/grant/time zones structures or failed to remove temporary table files.
2022-04-18T07:20:25.150342Z 0 [ERROR] Aborting
解决方案:
将
/etc/selinux/
目录下config文件中
SELINUX=enforcing修改为SELINUX=permissive
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
#SELINUX=enforcing
SELINUX=permissive
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted