Linux mysql服务器无法启动,或者重启

Old*_*org 5 mysql linux file-permissions

介绍

我在我的 Linux 机器上运行 MariaDB 和 Apache,今天遇到了一些问题。

我通过 SSH 连接到服务器,以下是我面临的一些问题。我完全不知道我在这里做什么。

我在做什么

步骤1:mysql -u USERNAME -p

错误2002(HY000):无法通过套接字'/var/run/mysqld/mysqld.sock'连接到本地MySQL服务器(2“没有这样的文件或目录”)

好的,所以我想,让我们尝试停止 mysql 服务


第2步:sudo service mysql stop

好的,没有错误,重启服务


步骤3:sudo service mysql restart

mysql.service 作业失败。有关详细信息,请参阅“systemctl status mysql.service”和“journalctl -xe”。

好的,我最好运行这两个命令并查看我得到的结果


步骤4:status mysql.service

在此输入图像描述

嗯..好吧,让我们尝试另一个


第5步:journalctl -xe

未找到日志文件。

好吧,我在这里迷路了..

MySQL错误日志

150824 14:42:58 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150824 14:42:58 [Note] /usr/sbin/mysqld (mysqld 10.0.20-MariaDB-0ubuntu0.15.04.1) starting as process 22637 ...
150824 14:42:58 [ERROR] mysqld: File '/var/lib/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
150824 14:42:58 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
150824 14:42:58 [ERROR] Plugin 'Aria' init function returned error.
150824 14:42:58 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
150824 14:42:58 [Note] InnoDB: Using mutexes to ref count buffer pool pages
150824 14:42:58 [Note] InnoDB: The InnoDB memory heap is disabled
150824 14:42:58 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
150824 14:42:58 [Note] InnoDB: Memory barrier is not used
150824 14:42:58 [Note] InnoDB: Compressed tables use zlib 1.2.8
150824 14:42:58 [Note] InnoDB: Using Linux native AIO
150824 14:42:58 [Note] InnoDB: Using CPU crc32 instructions
150824 14:42:58 [Note] InnoDB: Initializing buffer pool, size = 128.0M
150824 14:42:58 [Note] InnoDB: Completed initialization of buffer pool
150824 14:42:58 [ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode
150824 14:42:58 [ERROR] InnoDB: The system tablespace must be writable!
150824 14:42:58 [ERROR] Plugin 'InnoDB' init function returned error.
150824 14:42:58 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150824 14:42:58 [Note] Plugin 'FEEDBACK' is disabled.
150824 14:42:58 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
150824 14:42:58 [ERROR] Unknown/unsupported storage engine: InnoDB
150824 14:42:58 [ERROR] Aborting

150824 14:42:58 [Note] /usr/sbin/mysqld: Shutdown complete

150824 14:42:58 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Run Code Online (Sandbox Code Playgroud)

磁盘空间问题

看起来磁盘空间不是问题 在此输入图像描述

小智 3

这就是它无法启动的原因:

150824 14:42:58 [ERROR] mysqld: File '/var/lib/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
150824 14:42:58 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
Run Code Online (Sandbox Code Playgroud)

仔细检查 /var/lib/mysql 的权限。另外,请检查系统日志以查看 SE-Linux 或 Apparmor 是否存在干扰。