MySQL 启动时出错

MySQL 启动时出错

我无法启动 mysql,当我运行任何类型的启动命令时,无论是systemctl start mysqlservice mysql start,我都会收到相同的错误:

Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.

当我跑步时systemctl status mysql.service我得到了这个:https://hatebin.com/iefidgteub

或者如果我运行,mysql我就会得到ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)我环顾四周,然后我find / -type s尝试找到该mysqld.sock文件,但在输出中,mysqld.sock它不是它返回的文件之一

然后,如果我尝试跑步mysqld,我会得到https://hatebin.com/nyszqpalec

答案1

您发布的日志中存在错误:

mysqld: Error on realpath() on '/var/lib/mysql-files' (Error 2 - No such file or directory)
2020-08-03T11:17:14.960692Z 0 [ERROR] Failed to access directory for --secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server. Supplied value : /var/lib/mysql-files

确保目录/var/lib/mysql-files存在并且 MySQL 应该启动。

相关内容