gpt4 book ai didi

mysql - 我无法在 ubuntu 18.04 上安装 mysql

转载 作者:行者123 更新时间:2023-12-04 18:50:09 28 4
gpt4 key购买 nike

我正在尝试在我的 ubuntu 18.04 上安装 mysql-server,但出现 dpkg 错误
sudo apt-get install mysql-server之后的终端输出是

Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libaio1 libevent-core-2.1-6 mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 Suggested packages: mailx tinyca The following NEW packages will be installed: libaio1 libevent-core-2.1-6 mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server mysql-server-5.7 mysql-server-core-5.7 0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/19.1 MB of archives. After this operation, 155 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Preconfiguring packages ... Selecting previously unselected package mysql-common. (Reading database ... 274343 files and directories currently installed.) Preparing to unpack .../0-mysql-common_1%3a10.4.12+maria~eoan_all.deb ... Unpacking mysql-common (1:10.4.12+maria~eoan) ... Selecting previously unselected package libaio1:amd64. Preparing to unpack .../1-libaio1_0.3.110-5ubuntu0.1_amd64.deb ... Unpacking libaio1:amd64 (0.3.110-5ubuntu0.1) ... Selecting previously unselected package mysql-client-core-5.7. Preparing to unpack .../2-mysql-client-core-5.7_5.7.29-0ubuntu0.18.04.1_amd64.deb ... Unpacking mysql-client-core-5.7 (5.7.29-0ubuntu0.18.04.1) ... Selecting previously unselected package mysql-client-5.7. Preparing to unpack .../3-mysql-client-5.7_5.7.29-0ubuntu0.18.04.1_amd64.deb ... Unpacking mysql-client-5.7 (5.7.29-0ubuntu0.18.04.1) ... Selecting previously unselected package mysql-server-core-5.7. Preparing to unpack .../4-mysql-server-core-5.7_5.7.29-0ubuntu0.18.04.1_amd64.deb ... Unpacking mysql-server-core-5.7 (5.7.29-0ubuntu0.18.04.1) ... Selecting previously unselected package libevent-core-2.1-6:amd64. Preparing to unpack .../5-libevent-core-2.1-6_2.1.8-stable-4build1_amd64.deb ... Unpacking libevent-core-2.1-6:amd64 (2.1.8-stable-4build1) ... Setting up mysql-common (1:10.4.12+maria~eoan) ... Selecting previously unselected package mysql-server-5.7. (Reading database ... 274503 files and directories currently installed.) Preparing to unpack .../mysql-server-5.7_5.7.29-0ubuntu0.18.04.1_amd64.deb ... Unpacking mysql-server-5.7 (5.7.29-0ubuntu0.18.04.1) ... Selecting previously unselected package mysql-server. Preparing to unpack .../mysql-server_5.7.29-0ubuntu0.18.04.1_all.deb ... Unpacking mysql-server (5.7.29-0ubuntu0.18.04.1) ... Setting up libevent-core-2.1-6:amd64 (2.1.8-stable-4build1) ... Setting up libaio1:amd64 (0.3.110-5ubuntu0.1) ... Setting up mysql-client-core-5.7 (5.7.29-0ubuntu0.18.04.1) ... Setting up mysql-server-core-5.7 (5.7.29-0ubuntu0.18.04.1) ... Setting up mysql-client-5.7 (5.7.29-0ubuntu0.18.04.1) ... Setting up mysql-server-5.7 (5.7.29-0ubuntu0.18.04.1) ... /var/lib/dpkg/info/mysql-server-5.7.postinst: line 191: /usr/share/mysql-common/configure-symlinks: No such file or directory dpkg: error processing package mysql-server-5.7 (--configure): installed mysql-server-5.7 package post-installation script subprocess returned error exit status 127 dpkg: dependency problems prevent configuration of mysql-server: 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 No apport report written because the error message indicates its a followup error from a previous failure. Processing triggers for libc-bin (2.27-3ubuntu1) ... Processing triggers for systemd (237-3ubuntu10.39) ... Processing triggers for man-db (2.8.3-2ubuntu0.1) ... Processing triggers for ureadahead (0.100.0-21) ... ureadahead will be reprofiled on next reboot Errors were encountered while processing: mysql-server-5.7 mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1)



我已经尝试了在堆栈溢出和 Internet 上其他地方可以找到的所有其他解决方案。

我尝试过的解决方案包括 purging mysql , autoremove , autoclean , dist upgrade , reboot , removing /etc/mysql /var/lib/mysql以及我能找到的与此问题相关的几乎所有其他事情。它对我没有帮助,现在问这个问题是因为没有其他答案对我有帮助。我不担心丢失我系统上可能拥有的任何数据库。

我必须补充一点,因为安装 mysql 对我不起作用,所以我使用了 mongodb。它最初安装得很好,但现在即使删除和安装 mongodb 也会出现同样的错误。

最佳答案

请尝试以下步骤,

1.) 首先,通过键入以下内容更新 apt 包索引:

$sudo apt update

2.)然后使用以下命令安装 MySQL 包:
$sudo apt install mysql-server

3.)安装完成后,MySQL服务会自动启动。要检查 MySQL 服务器是否正在运行,请键入:
$sudo systemctl status mysql

输出

mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-2-20 11:30:23 PDT; 5min ago
Main PID: 17382 (mysqld)
Tasks: 27 (limit: 2321)
CGroup: /system.slice/mysql.service
`-17382 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid

关于mysql - 我无法在 ubuntu 18.04 上安装 mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60369623/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com