Docker中启动mysql报错: Failed to get D-Bus connection

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS PostgreSQL,集群系列 2核4GB
简介:

docker版本:

[root@localhost ~]# docker versionClient:

 Version:         1.10.3

 API version:     1.22

 Package version: docker-common-1.10.3-46.el7.centos.10.x86_64

 Go version:      go1.6.3

 Git commit:      d381c64-unsupported

 Built:           Thu Aug  4 13:21:17 2016

 OS/Arch:         linux/amd64


Server:

 Version:         1.10.3

 API version:     1.22

 Package version: docker-common-1.10.3-46.el7.centos.10.x86_64

 Go version:      go1.6.3

 Git commit:      d381c64-unsupported

 Built:           Thu Aug  4 13:21:17 2016

 OS/Arch:         linux/amd64123456789101112131415161718

镜像版本


[root@b2ca5610d3da /]# cat /etc/redhat-releaseCentOS Linux release 7.2.1511 (Core) 12

    在docker中通过systemctl 启动服务的时候总是报Failed to get D-Bus connection: Operation not permitted 这样的错误提示。


[root@25d27693a24d ~]# systemctl start sshd

Failed to get D-Bus connection: Operation not permitted

    解决办法就是在docker run 的时候运行/usr/sbin/init 。比如:


[root@localhost /]# docker run -tid --name hadoopbase centos/hadoopbase:v001 /usr/sbin/init

    这样运行起来的container就可以使用systemctl来启动服务了,有的人说在CentOS7.2中解决了通过systemctl运行报错的问题,但是我在实际操作中还是遇到这样的问题。

    还有一种解决办法,就是在通过Dockerfile生成镜像文件的时候,通过CMD来执行/usr/sbin/init这条命令,即:CMD [ "/usr/sbin/init"];


本文转自 Mr_sheng 51CTO博客,原文链接:http://blog.51cto.com/sf1314/2057098


相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
打赏
0
0
0
0
344
分享
相关文章
docker pull mysql:8.0.26提示Error response from daemon: Get “https://registry-1.docker.io/v2/“: EOF错误
docker pull mysql:8.0.26提示Error response from daemon: Get “https://registry-1.docker.io/v2/“: EOF错误
升级到MySQL 8.4,MySQL启动报错:io_setup() failed with EAGAIN
当MySQL 8.4启动时报错“io_setup() failed with EAGAIN”时,通常是由于系统AIO资源不足所致。通过增加AIO上下文数量、调整MySQL配置、优化系统资源或升级内核版本,可以有效解决这一问题。上述解决方案详细且实用,能够帮助管理员快速定位并处理此类问题,确保数据库系统的正常运行。
190 9
Docker - 运行 Mysql 容器后报错:[ERROR] --initialize specified but the data directory has files in it. Aborting.
Docker - 运行 Mysql 容器后报错:[ERROR] --initialize specified but the data directory has files in it. Aborting.
1702 0
Docker - 运行 Mysql 容器后报错:[ERROR] --initialize specified but the data directory has files in it. Aborting.
docker启动mysql多实例连接报错Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
docker启动mysql多实例连接报错Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
376 0
suse系统mysql不能启动:Unit mysql.service failed to load: No such file or directory
suse系统mysql不能启动:Unit mysql.service failed to load: No such file or directory
158 0
docker 内执行 systemctl 报错 解决方案: Failed to get D-Bus connection: Operation not permitted
docker 内部安装 systemctl 工具包的路径非系统路径,拷贝到系统路径 /bin/ 目录下,并且给执行权限即可
693 1
navicat 连接Docker中mysql容器报错:Client does not support authentication protocol requested by server;
navicat 连接Docker中mysql容器报错:Client does not support authentication protocol requested by server;
357 0
navicat 连接Docker中mysql容器报错:Client does not support authentication protocol requested by server;
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等