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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了