Docker容器使用问题:Failed to get D-Bus connection: Operation not permitted
在CentOS7 中,docker容器中yum 安装完mysql后,启动mysqld报错
# systemctl start mysqld
Failed to get D-Bus connection: Operation not permitted
解决办法:
生成容器:
#docker run -itd -name mysql mysql-yum-install /usr/sbin/init
进入容器:
# docker exec -it mysql /bin/bash
这样可以使用systemctl启动服务了。
执行代码:
[[email protected] ~]# docker run -itd --name mysql mysql-yum-install /usr/sbin/init
fc57c212614e013f22720ba471d5dd0ba0c203e629500818a568f55c7bfd1775
[[email protected] ~]# docker exec -it mysql /bin/bash
[[email protected] /]# systemctl start mariadb
[[email protected] /]#
原文地址:http://blog.51cto.com/fengyunshan911/2113979
时间: 2024-10-12 18:34:38