FreeBSD 的Ubuntu jail里启动mysql服务器失败的解决方法

在FreeBSD 的jail里安装Ubuntu后,一直没有尝试安装mysql服务器,网上也没有找到相应的文档(这证明要么太难,天底下就没有解决方案;要么太容易,以至于显而易见,所以不需要文档)。

今天终于被迫,要解决这个问题!

首先,在Ubuntu jail里安装mysql server

直接使用apt安装即可:

复制代码
apt install mysql-server

安装好之后,跟普通Ubuntu系统里不一样,没有自动启动mysql服务(也许这里记错了)

普通Ubuntu系统里,启动mysql服务非常简单,直接执行:

复制代码
systemctl start mysql
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

报错,使用 systemctl status mysql命令也是报错:

systemctl status mysql

System has not been booted with systemd as init system (PID 1). Can't operate.

Failed to connect to bus: Host is down

系统没有使用 systemd 作为初始化系统(init system)

最终使用如下命令启动服务:

复制代码
service mysql start

再看看服务器状态:

复制代码
service mysql status
 * /usr/bin/mysqladmin  Ver 8.0.39-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu))
Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Server version		8.0.39-0ubuntu0.22.04.1
Protocol version	10
Connection		Localhost via UNIX socket
UNIX socket		/var/run/mysqld/mysqld.sock
Uptime:			12 min 11 sec

Threads: 2  Questions: 10  Slow queries: 0  Opens: 438  Flush tables: 3  Open tables: 27  Queries per second avg: 0.013

终于在Ubuntu jail里启动mysql服务拉!

相关推荐
●^●15 分钟前
Linux 权限修改详解:chmod 命令与权限数字的秘密
linux
唯独失去了从容18 分钟前
WebRTC服务器Coturn服务器中的通信协议
运维·服务器·webrtc
光而不耀@lgy1 小时前
C++初登门槛
linux·开发语言·网络·c++·后端
joker_zsl1 小时前
docker的安装和简单使用(ubuntu环境)
运维·docker·容器
偶尔微微一笑1 小时前
AI网络渗透kali应用(gptshell)
linux·人工智能·python·自然语言处理·编辑器
Run1.2 小时前
深入解析 Linux 中动静态库的加载机制:从原理到实践
linux·运维·服务器
VI8664956I262 小时前
全链路自动化AIGC内容工厂:构建企业级智能内容生产系统
运维·自动化·aigc
The Mr.Nobody2 小时前
STM32MPU开发之旅:从零开始构建嵌入式Linux镜像
linux·stm32·嵌入式硬件
老兵发新帖2 小时前
Ubuntu 上安装 Conda
linux·ubuntu·conda
秋秋秋秋秋雨2 小时前
linux安装单节点Elasticsearch(es),安装可视化工具kibana
linux·elasticsearch·jenkins