我正在尝试在我的 Ubuntu 16.04 VPS 上安装 MySQL,但是当我尝试使用sudo apt install mysql-server mysql-client
(甚至sudo apt install mysql-server
)安装它时,出现以下错误:
Setting up mysql-server-5.7 (5.7.22-0ubuntu0.16.04.1) ...
/var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/ configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up libhtml-tagset-perl (3.20-2) ...
Setting up liburi-perl (1.71-1) ...
Setting up libhtml-parser-perl (3.72-1) ...
Setting up libcgi-pm-perl (4.26-1) ...
Setting up libfcgi-perl (0.77-1build1) ...
Setting up libcgi-fast-perl (1:2.10-1) ...
Setting up libencode-locale-perl (1.05-1) ...
Setting up libhtml-template-perl (2.95-2) ...
Setting up libtimedate-perl (2.3000-2) ...
Setting up libhttp-date-perl (6.02-1) ...
Setting up libio-html-perl (1.001-1) ...
Setting up liblwp-mediatypes-perl (6.02-1) ...
Setting up libhttp-message-perl (6.11-1) ...
Setting up mysql-client (5.7.22-0ubuntu0.16.04.1) ...
dpkg: dependency problems prevent configuration of mysql-server:
No apport report written because the error message indicates its a followup erro r from a previous failure.
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for systemd (229-4ubuntu21.2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
我已经尝试使用清除所有 mysql 包和依赖项
sudo dpkg -l | grep mysql
sudo apt-get--purge 自动删除
rm -r /var/lib/mysql
重启
但到目前为止还没有运气,有人可以帮我解决这个问题吗?我对 Ubuntu 真的很陌生,我无法让它工作。当我输入时也会显示以下内容service mysql status
:
root@ubuntu:~# service mysql status
● mysql.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
Jul 24 07:06:10 ubuntu systemd[1]: Stopped MySQL Community Server.
Jul 24 07:14:05 ubuntu systemd[1]: Stopped MySQL Community Server.