在 Ubuntu 上安装 MySQL

在 Ubuntu 上安装 MySQL

我正在尝试在 ubuntu 16.04 上安装 MySQL。我查看了这里的各种帖子和 serverfault 以尝试解决该问题,但问题仍然存在。

我使用以下方式安装 MySQL:

sudo apt-get install mysql-server

然后,设置 root 密码后,安装就挂起了:

Renaming removed key_buffer and myisam-recover options (if present)

我已经清除并重新启动,但没有成功。


Oct 11 11:56:40 ip-172-31-47-249 systemd[1]: Started ACPI event daemon.
Oct 11 11:56:41 ip-172-31-47-249 systemd[1]: Starting MySQL Community Server...
Oct 11 11:56:45 ip-172-31-47-249 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Oct 11 11:57:07 ip-172-31-47-249 dhclient[895]: DHCPREQUEST of 172.31.47.249 on eth0 to 172.31.32.1 port 67 (xid=0x132b1603)
Oct 11 11:57:07 ip-172-31-47-249 dhclient[895]: DHCPACK of 172.31.47.249 from 172.31.32.1
Oct 11 11:57:08 ip-172-31-47-249 dhclient[895]: bound to 172.31.47.249 -- renewal in 1677 seconds.
Oct 11 11:57:22 ip-172-31-47-249 systemd[1]: Failed to start MySQL Community Server.
Oct 11 11:57:22 ip-172-31-47-249 systemd[1]: mysql.service: Unit entered failed state.
Oct 11 11:57:22 ip-172-31-47-249 systemd[1]: mysql.service: Failed with result 'exit-code'.
Oct 11 11:57:22 ip-172-31-47-249 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Oct 11 11:57:22 ip-172-31-47-249 systemd[1]: Stopped MySQL Community Server.
Oct 11 11:57:22 ip-172-31-47-249 systemd[1]: Starting MySQL Community Server..

答案1

取自发射台

[Workaround Option 1/3]

To reset your MySQL configuration back to defaults,
type "sudo update-alternatives --remove my.cnf /etc/mysql/my.cnf.migrated" after the upgrade.
Then use "sudo service mysql start" to start the MySQL daemon
and "sudo apt-get -f install" to recover your system packaging state.

相关内容