出现状况:

使用命令 servcie mysql start 提示失败

用命令 service mysql status 提示错误 : “Error: 2 (没有那个文件或目录)”

 

出错背景说明:

64位 ubuntu 20.04系统,之前可以正常运行,后来节省系统资源 用命令: 

sudo systemctl disable mysql 关闭了mysql服务的自动启动

后来正好遇到ubuntu 更新了mysql的部分库 二次启动mysql时候出现了这个问题

 

解决方案:

1. 使用命令 : journalctl -xe 查看启动时候的错误日志 ,发现在尾部错误发生时候有提示  Could not open file '/var/log/mysql/error.log' for error lo.....

2. 创建对应的文件夹 mkdir /var/log/mysql/ ,同时用命令赋予文件夹宽泛权限 chmod 777 /var/log/mysql/

3. service mysql restart 重启服务即可

 

PS:使用sudo systemctl enable mysql 要注销或者重启来应用修改 (可能)

 journalctl -xe 命令可以用上下键来浏览更早以前的日志,ctrl+c 退出

GitHub 加速计划 / li / linux-dash
10
2
下载
A beautiful web dashboard for Linux
最近提交(Master分支:1 个月前 )
186a802e added ecosystem file for PM2 5 年前
5def40a3 Add host customization support for the NodeJS version 5 年前
Logo

新一代开源开发者平台 GitCode,通过集成代码托管服务、代码仓库以及可信赖的开源组件库,让开发者可以在云端进行代码托管和开发。旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐