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

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介:

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
相关文章
|
关系型数据库 MySQL Windows
windows安装mysql报错Remove of the Service Denied!
windows安装mysql报错Remove of the Service Denied!
187 0
|
2月前
|
关系型数据库 MySQL Linux
升级到MySQL 8.4,MySQL启动报错:io_setup() failed with EAGAIN
当MySQL 8.4启动时报错“io_setup() failed with EAGAIN”时,通常是由于系统AIO资源不足所致。通过增加AIO上下文数量、调整MySQL配置、优化系统资源或升级内核版本,可以有效解决这一问题。上述解决方案详细且实用,能够帮助管理员快速定位并处理此类问题,确保数据库系统的正常运行。
120 9
|
关系型数据库 MySQL Devops
docker容器刚启动就停止 — 运行mysql 报错 mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
docker容器刚启动就停止 — 运行mysql 报错 mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
1241 0
|
5月前
|
关系型数据库 MySQL 数据库
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’
297 0
|
关系型数据库 MySQL Docker
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.
1618 0
Docker - 运行 Mysql 容器后报错:[ERROR] --initialize specified but the data directory has files in it. Aborting.
|
8月前
|
关系型数据库 MySQL 数据安全/隐私保护
mysql无法启动服务connect to server at ‘localhost‘ failed
mysql无法启动服务connect to server at ‘localhost‘ failed
|
关系型数据库 MySQL Linux
Linux连接MySQL时的错误:Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
连接本地的MySQL数据库引擎时候出现的错误。用mysql_error()函数获取到错误提示:
|
域名解析 关系型数据库 MySQL
mysql中出现Unit mysql.service could not be found 的解决方法
mysql中出现Unit mysql.service could not be found 的解决方法
5027 1
|
关系型数据库 MySQL Linux
DVWA CentOS Could not connect to the MySQL service. Please check the config file.
DVWA CentOS Could not connect to the MySQL service. Please check the config file.
89 0
|
关系型数据库 MySQL Linux
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
112 0

热门文章

最新文章