![mysqli::real_connect(): (HY000/2002): 没有此文件或目录](https://linux22.com/image/1206967/mysqli%3A%3Areal_connect()%3A%20(HY000%2F2002)%3A%20%E6%B2%A1%E6%9C%89%E6%AD%A4%E6%96%87%E4%BB%B6%E6%88%96%E7%9B%AE%E5%BD%95.png)
我的 MySQL 服务突然停止了。
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2021-06-10 10:56:09 UTC; 18min ago
Process: 1378 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Process: 1386 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Main PID: 1386 (code=exited, status=1/FAILURE)
Status: "Server startup in progress"
Error: 13 (Permission denied)
Jun 10 10:56:09 ssdnodes-6033b79bb86b3 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Jun 10 10:56:09 ssdnodes-6033b79bb86b3 systemd[1]: mysql.service: Failed with result 'exit-code'.
Jun 10 10:56:09 ssdnodes-6033b79bb86b3 systemd[1]: Failed to start MySQL Community Server.
Jun 10 10:56:09 ssdnodes-6033b79bb86b3 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Jun 10 10:56:09 ssdnodes-6033b79bb86b3 systemd[1]: Stopped MySQL Community Server.
Jun 10 10:56:09 ssdnodes-6033b79bb86b3 systemd[1]: mysql.service: Start request repeated too quickly.
Jun 10 10:56:09 ssdnodes-6033b79bb86b3 systemd[1]: mysql.service: Failed with result 'exit-code'.
Jun 10 10:56:09 ssdnodes-6033b79bb86b3 systemd[1]: Failed to start MySQL Community Server.
root@ssdnodes-6033b79bb86b3:~#
错误日志显示此错误:
mysqld: File './binlog.index' not found (OS errno 13 - Permission denied)
2021-06-10T10:56:09.263519Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25-0ubuntu0.20.04.1) starting as process 1377
2021-06-10T10:56:09.265942Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-06-10T10:56:09.266149Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.25-0ubuntu0.20.04.1) (Ubuntu).
mysqld: File './binlog.index' not found (OS errno 13 - Permission denied)
2021-06-10T10:56:09.768183Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25-0ubuntu0.20.04.1) starting as process 1386
2021-06-10T10:56:09.771054Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-06-10T10:56:09.771264Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.25-0ubuntu0.20.04.1) (Ubuntu).