![MySQL 无法在 AWS(EC2-Ubuntu 实例)上启动](https://linux22.com/image/930059/MySQL%20%E6%97%A0%E6%B3%95%E5%9C%A8%20AWS%EF%BC%88EC2-Ubuntu%20%E5%AE%9E%E4%BE%8B%EF%BC%89%E4%B8%8A%E5%90%AF%E5%8A%A8.png)
我在 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 实例空间不足。删除一些文件后,我就可以重新运行它。