我按照 vultr 上的说明在 VPS 上安装 LAMP 堆栈(https://www.vultr.com/docs/how-to-install-apache-mysql-and-php-on-ubuntu-16-04)。当我尝试在启动时启用 mysql 时,出现错误。
# sudo systemctl enable mysql.service
Synchronizing state of mysql.service with SysV service script with
/lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable mysql
Failed to enable unit: Refusing to operate on linked unit file
mysql.service
我对设置 VPS 还不太熟悉,所以任何帮助都将非常感谢。
答案1
尝试 sudo systemctl enable mariadb.service
因为 mysql.service 是 mariadb.service 的符号链接
答案2
mysql.service 可能已部分启用,请尝试
sudo systemctl disable mysql.service
sudo systemctl enable mysql.service