解决 linux(ubuntu 20.04)下 启动mysql 错误,无法启动服务 报错 Error: 2 (没有那个文件或目录)
出现状况:使用命令 servcie mysql start 提示失败用命令 service mysql status 提示错误 :“Error: 2 (没有那个文件或目录)”出错背景说明:64位 ubuntu 20.04系统,之前可以正常运行,后来节省系统资源 用命令:sudo systemctl disable mysql 关闭了mysql服务的自动启动后来正好遇到ubuntu 更新了mysql
·
出现状况:
使用命令 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 退出
更多推荐
所有评论(0)