在安裝docker mysql:5.7版本時,出現錯誤:
mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 13 - Permission denied)
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
ERROR: mysqld failed while attempting to check config
command was: "mysqld --verbose --help"
原因
因爲Centos7安全Selinux禁止了一些安全權限,導致mysql和mariadb在進行掛載/var/lib/mysql的時候會提示如下信息
解決方法
在docker run中加入 –privileged=true 給容器加上特定權限