【原创】大叔经验分享(96)docker启动MySQL报错

docker启动mysql反复重启,通过

# docker logs $container_id

查看日志如下:

chown: cannot read directory ‘/var/lib/mysql/‘: Permission denied

但是目录权限确认没问题,即使 chmod 777 还是报相同的错误,后来发现是selinux的问题

查看状态

# getenforce

临时禁用

# setenforce 0

永久禁用

# vi /etc/selinux/config

# 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=disable

禁用之后docker启动mysql正常

相关推荐