我一直在努力在 Ubuntu 20.04 中安装 mysql 服务器。我做过sudo apt-get install mysql-server
之前已经安装了 mariadb。无论我遵循哪篇文章或指南,当我尝试使用或安装时,我总是会收到此消息sudo apt-get install --reinstall mysql-server-8.0
:
done!
update-alternatives: using /var/lib/mecab/dic/ipadic-utf8 to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode
Setting up mysql-server-8.0 (8.0.29-0ubuntu0.20.04.3) ...
invoke-rc.d: policy-rc.d denied execution of stop.
/var/lib/dpkg/info/mysql-server-8.0.postinst: line 194: /usr/share/mysql-common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 127
Processing triggers for systemd (245.4-4ubuntu3.17) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
Errors were encountered while processing:
mysql-server-8.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
每次我尝试运行 mysql 时也会收到此消息:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket /var/run/mysqld/mysqld.sock' (2)
我尝试关注许多帖子,例如: 无法让 MYSQL8 在 Ubuntu 20.04 上运行/n https://mariadb.com/kb/en/uninstall-or-delete-mariadb-completely-for-re-installation/
我不知所措,几乎要重新安装 Ubuntu,但仅仅为了让 mysql 正常运行而这样做简直太荒谬了。我怀疑这个问题是 mariadb 留下的某种痕迹,但我已经尝试了所有能找到的方法来消除它,包括 grep dpkg 内容并手动删除。任何帮助都非常感谢。