无法在Mgt开发环境中启动mysql

时间:2017-01-12 17:51:46

标签: mysql docker

我在管理开发环境提供的全新Docker容器上发现了这个错误:

root@mgt-dev-70:~# /etc/init.d/mysql start
/usr/sbin/mysqld: error while loading shared libraries: libpthread.so.0: cannot open shared object file: Permission denied
[....] Starting MySQL (Percona Server) database server: mysqld/usr/sbin/mysqld: error while loading shared libraries: libpthread.so.0: cannot open shared object file: Permission denied
/usr/sbin/mysqld: error while loading shared libraries: libpthread.so.0: cannot open shared object file: Permission denied
 ./usr/sbin/mysqld: error while loading shared libraries: libpthread.so.0: cannot open shared object file: Permission denied
 ./usr/sbin/mysqld: error while loading shared libraries: libpthread.so.0: cannot open shared object file: Permission denied

我使用了这个教程https://www.mgt-commerce.com/documentation/mgt-development-environment-run-container,我拉了mgtcommerce/mgt-development-environment-7.0

1 个答案:

答案 0 :(得分:1)

我们认为这是apparmor的一个问题。

[192088.261031] audit: type=1400 audit(1516074899.710:1304): apparmor="DENIED" operation="open" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="var/lib/docker/aufs/diff/e5182def06a6a8b8d08c0a6d0c3a439585d2e7aea90507c245d421c319431d51/lib/x86_64-linux-gnu/libpthread-2.19.so" pid=18970 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[192088.261039] audit: type=1400 audit(1516074899.710:1305): apparmor="DENIED" operation="getattr" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="var/lib/docker/aufs/diff/e5182def06a6a8b8d08c0a6d0c3a439585d2e7aea90507c245d421c319431d51/lib/x86_64-linux-gnu" pid=18970 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[192088.261066] audit: type=1400 audit(1516074899.710:1306): apparmor="DENIED" operation="getattr" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="var/lib/docker/aufs/diff/e5182def06a6a8b8d08c0a6d0c3a439585d2e7aea90507c245d421c319431d51/usr/lib/x86_64-linux-gnu" pid=18970 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[192088.261083] audit: type=1400 audit(1516074899.710:1307): apparmor="DENIED" operation="getattr" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="var/lib/docker/aufs/diff/e5182def06a6a8b8d08c0a6d0c3a439585d2e7aea90507c245d421c319431d51/lib" pid=18970 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[192088.261103] audit: type=1400 audit(1516074899.710:1308): apparmor="DENIED" operation="getattr" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="var/lib/docker/aufs/diff/e5182def06a6a8b8d08c0a6d0c3a439585d2e7aea90507c245d421c319431d51/usr/lib" pid=18970 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=0 ouid=0

您可以通过登录容器并运行以下命令来修复它。

mv /usr/sbin/mysqld /usr/bin/mysqld
ln -nfs /usr/bin/mysqld /usr/sbin/mysqld