MySQL 无法在 AWS(EC2-Ubuntu 实例)上启动

MySQL 无法在 AWS(EC2-Ubuntu 实例)上启动

我在 AWS (ES2) 上运行 Ubuntu 实例。升级实例后,我无法启动 MySQL。升级之前,MySQL 运行正常。

service mysql start输出:

Authentication is required to start 'mysql.service'.
Authenticating as: Ubuntu (ubuntu)
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Failed to start mysql.service: Access denied
See system logs and 'systemctl status mysql.service' for details.

我试过: systemctl status mysql.service 输出:

 mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2020-10-12 17:22:21 UTC; 3h 12min ago
  Process: 3610 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status
  Process: 3591 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)

Oct 12 17:22:21 ip-172-31-30-161 systemd[1]: Failed to start MySQL Community Server.
Oct 12 17:22:21 ip-172-31-30-161 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Oct 12 17:22:21 ip-172-31-30-161 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Oct 12 17:22:21 ip-172-31-30-161 systemd[1]: Stopped MySQL Community Server.
Oct 12 17:22:21 ip-172-31-30-161 systemd[1]: mysql.service: Start request repeated too quickly.
Oct 12 17:22:21 ip-172-31-30-161 systemd[1]: mysql.service: Failed with result 'exit-code'.
Oct 12 17:22:21 ip-172-31-30-161 systemd[1]: Failed to start MySQL Community Server.
Oct 12 17:22:24 ip-172-31-30-161 systemd[1]: mysql.service: Start request repeated too quickly.
Oct 12 17:22:24 ip-172-31-30-161 systemd[1]: mysql.service: Failed with result 'exit-code'.
Oct 12 17:22:24 ip-172-31-30-161 systemd[1]: Failed to start MySQL Community Server.

mysql --version输出: mysql Ver 14.14 Distrib 5.7.29, for Linux (x86_64) using EditLine wrapper

which mysql输出:usr/bin/mysql

另外,我尝试了这个:mysql -u root -p输出是: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

我被困住了,不知道要去哪儿。

注意:我不想丢失旧数据库。

答案1

已解决:主要问题是 AWS 实例空间不足。删除一些文件后,我就可以重新运行它。

相关内容