磁盘满了,MySQL 无法启动

最近此站点没法访问了,cloudflare 提示连接我的服务器出错,我也不知道原因是什么,二话不说,先把服务器重启。再刷新网站,提示没法连接数据库。我就再重启 MySQL:

systemctl start mysqld

结果重启失败,报出如下的错误:

Starting mysqld (via systemctl):  Job for mysqld.service failed because the control process exited with an error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

我的服务器只花了 10 美元,要运行 WordPress 程序,下意识觉得磁盘空间不够,因为才 10g 的空间,如何查看磁盘的占用情况呢?运行如下指令:

df -h

可以看到磁盘的占用空间达到了 94%,10g 这么快就用完了。

Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        219M     0  219M   0% /dev
tmpfs           234M     0  234M   0% /dev/shm
tmpfs           234M   13M  222M   6% /run
tmpfs           234M     0  234M   0% /sys/fs/cgroup
/dev/vda1       9.4G  8.3G  604M  94% /
tmpfs            47M     0   47M   0% /run/user/1002

那如何检测出哪个文件占用的大,将其删除释放空间出来呢?运行如下指令:

# du -sh *
0       bin
231M    boot
1.2G    data
0       dev
23M     etc
28K     home
0       lib
0       lib64
16K     lost+found
4.0K    media
4.0K    mnt
4.0K    opt
0       proc
1.5G    root
13M     run
0       sbin
4.0K    srv
0       sys
44K     tmp
4.9G    usr
493M    var

可以看到 usr 目录下占用了 5g,将近一半的空间。进入文件夹,删掉大文件,重启 mysqld 服务就搞定了。

进入 usr 目录,看看哪里占用较大。

# du -sh *
119M	bin
4.0K	games
41M	include
681M	lib
278M	lib64
103M	libexec
3.2G	local
33M	sbin
482M	share
852K	src
0	tmp

接着进入 local

# cd local
# du -sh *
2.0M	bin
5.0M	curl
4.0K	etc
12M	freetype
4.0K	games
103M	imagemagick
780K	include
120M	lib
8.0K	lib64
4.0K	libexec
2.6G	mysql
5.1M	nginx
162M	node
259M	php
4.0K	sbin
2.2M	share
4.0K	src

我已经很久不用洗发水和沐浴露

用洗发水和沐浴露是小时候就养成的习惯了,从来没有思考过,为什么要用。我也没有去考究洗发水这种东西是什么开始流行的,一直觉得这个得必须用。直到 2022 年,一次洗发水用完了,我再也没有买。

一开始不用洗发水是觉得自己可能要秃顶了,得排查一下原因,先控制一下变量。刚开始几天,确实有点不习惯,觉得头洗不干净,有点油。过不了 2-3 个月,就适应了。人体是很神奇的系统,会自我调节,自己控制出油量。以前 2 天不洗头,黏糊糊的感觉似乎能造出任意发型了。现在 2 天不洗头,也不会觉得很油,脑袋感觉还是很清爽。

继续阅读“我已经很久不用洗发水和沐浴露”

开庭

2025-11-30

从几个单词聊香港大火

2025-11-29

获取当前分支的最近 tag 是用这条命令还是这条,就不能搞一条简单的指令么

You’d think there’d be a dead-simple Git command to return the latest tag pointing to the current branch. But the answer, as with many things in Git, is a bit more nuanced. If you’re here for a quick fix, here’s the magic one-liner:

git describe –tags $(git rev-list –tags –max-count=1)

git describe –abbrev=0

https://medium.com/code-kings/git-how-to-get-the-latest-git-tag-from-your-current-branch-without-the-guesswork-31a4fd57a029

继续阅读“开庭”

黄金大涨

2025-10-31

What is GeoGebra?

GeoGebra is a dynamic mathematics software for all levels of education that brings together geometry, algebra, spreadsheets, graphing, statistics and calculus in one engine. In addition, GeoGebra offers an online platform with over 1 million free classroom resources created by our multilingual community. These resources can be easily shared through our collaboration platform GeoGebra Classroom where student progress can be monitored in real time.

https://www.geogebra.org/geometry

2025-10-28

红楼梦中的性学摘录,关键语句自寻,这样的细节描写问你爱不爱

继续阅读“黄金大涨”

从几个单词聊香港大火

《红楼梦》的英文译名,有几种译法,一种是《A Dream of Red Mansions》,一种是《A Dream of Red Chamber》。我特意去查了一下,mansion 和 chamber 这 2 个单词是什么意思,用的字典是《牛津高阶英汉双解词典》。

mansion:a large,impressive house。中文译为公馆,宅邸。大而漂亮的房子,很符合贾家的大门大户。

chamber:a hall in a public building that is used for formal meetings。中文译为会议厅,这个翻译似乎不是很妥当,没有上面的贴切。

自然而然,我也联想到了 house 和 building 是什么。我们也来一起查一下。

house:a building for people to live in,usually for one family。房屋,住宅。只针对一家一户的。

building:a structure such as a house or school that has a roof and walls。建筑物,楼房。这个单词更偏向建筑,不一定指代是家,还有更多钢筋水泥的味道。

继续阅读“从几个单词聊香港大火”

幹工作進度

2025-09-01

这罗永浩老是打断李想的发言,作为一个采访者显得很不专业,没有让其做出完整表达。而且时间长不见得是深度访谈,提问的方式应该层层递进

【李想×罗永浩!四小时马拉松访谈!李想首度公开讲述25年创业之路】

https://www.bilibili.com/video/BV1FwY4zkEef/?share_source=copy_web&vd_source=a6b620917b053db9586b3ee8d0f54ca6

老罗总是在为自己的私欲去提问,不会去考虑观众应该会怎么提问。看创业者的创业故事,也会带来很多启发。比如怎么组建团队,怎么熟悉业务,怎么融资等等

2025-09-02

KeyboardEvent: keyCode property Deprecated

Inconsistent behavior: Different browsers and keyboard layouts can return different values for the same key, making it unreliable for cross-browser use.

Ambiguity: keyCode does not always clearly indicate which key was pressed, especially for non-character keys or when modifier keys are involved.

Css 诞生的背景,一开始居然是用户能改变样式,反而程序员却不能

继续阅读“幹工作進度”

去洞口看寳

2025-08-31

格鲁夫给经理人的第一课,这个书还是很有料,能带来不少启发

要提高超出,第一要培训,让大家成为大佬;第二要激励,要给钱。

脑力劳动不是工厂流水线,设定 kpi 就能搞定,绩效的评定指标和效用没有那么明显。

2025-08-30

chatgpt 是什么时候流行的,感觉现在的大模型满天飞

Anthropic PBC is an American artificial intelligence (AI) startup company founded in 2021. Anthropic has developed a family of large language models (LLMs) named Claude. According to the company, it researches and develops AI to “study their safety properties at the technological frontier” and use this research to deploy safe models for the public.[5][6]

Anthropic was founded by former members of OpenAI, including siblings Daniela Amodei and Dario Amodei.[7] In September 2023, Amazon announced an investment of up to $4 billion, followed by a $2 billion commitment from Google in the following month.

继续阅读“去洞口看寳”