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 
posted @   昨夜风雨声  阅读(182)  评论(0编辑  收藏  举报  
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示