无法在 Ubuntu 16.04 上安装 MySQL

     2023-02-24     78

关键词:

【中文标题】无法在 Ubuntu 16.04 上安装 MySQL【英文标题】:Can't install MySQL on Ubuntu 16.04 【发布时间】:2017-12-30 23:05:04 【问题描述】:

我在安装 mysql-server 之前安装了 mariadb-server(我不应该这样做),所以我清除了 mariadb* 并将其从存储库中删除。但是,我无法安装mysql-server

sudo apt-get install mysql-server 之后,我得到:

Setting up mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) ...
invoke-rc.d: could not determine current runlevel
 * Stopping MySQL database server mysqld                                                                                                                                     [ OK ] update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
invoke-rc.d: could not determine current runlevel
invoke-rc.d: could not determine current runlevel
 * Stopping MySQL database server mysqld                                                                                                                                     [ OK ] invoke-rc.d: could not determine current runlevel
mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysql_upgrade failed with exit status 11
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) ...
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
Processing triggers for libc-bin (2.23-0ubuntu9) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 mysql-server-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)

运行sudo apt-get install -f后,我得到:

Setting up mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) ...
invoke-rc.d: could not determine current runlevel
 * Stopping MySQL database server mysqld                                                                                                                                     [ OK ] Renaming removed key_buffer and myisam-recover options (if present)
invoke-rc.d: could not determine current runlevel
invoke-rc.d: could not determine current runlevel
 * Stopping MySQL database server mysqld                                                                                                                                     [ OK ] invoke-rc.d: could not determine current runlevel
mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysql_upgrade failed with exit status 11
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 1
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.
                                                                                                          Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

如何绕过这些错误并安装mysql-server

【问题讨论】:

或许在askubuntu.com 发帖会更好 如果您在 [askubuntu.com] 中提出这些问题可能会更好 ps aux | grep mysql 并杀死进程 【参考方案1】:

我通过删除apt-get purge mysql* 没有删除的所有 MySQL 文件来让它工作:

sudo rm -rf /var/lib/mysql/mysql

【讨论】:

这对我没有帮助 也许很明显,但我想应该提到的是,删除这个目录也很可能会删除你所有的数据库。

无法在 Docker 中的 ubuntu 16.04 上安装 openssh-server

】无法在Docker中的ubuntu16.04上安装openssh-server【英文标题】:Unabletoinstallopenssh-serveronubuntu16.04inDocker【发布时间】:2020-05-0110:42:48【问题描述】:我正在运行DockerforMac,运行最新版本2.1.0.5。我的同事在Windows和Ubuntu上运行Docker都没... 查看详情

无法在 Ubuntu 16.04 服务器上安装 dotnet-sdk2.1

】无法在Ubuntu16.04服务器上安装dotnet-sdk2.1【英文标题】:Cannotinstalldotnet-sdk2.1onUbuntu16.04server【发布时间】:2018-12-0803:15:02【问题描述】:我今天尝试在我的Ubuntu16.04服务器上安装dotnet-sdk2.1.101,但出现以下错误:“dotnet-sdk-2.1.101:D... 查看详情

如何在 Ubuntu 16.04 上安装 mysql2 [错误:安装 mysql2 时出错:错误:无法构建 gem 本机扩展。] [重复]

...何在Ubuntu16.04上安装mysql2[错误:安装mysql2时出错:错误:无法构建gem本机扩展。][重复]【英文标题】:Howtoinstallmysql2onUbuntu16.04[ERROR:Errorinstallingmysql2:ERROR:Failedtobuildgemnativeextension.][duplicate]【发布时间】:2016-09-1111:08:00【问题描述... 查看详情

在 ubuntu 16.04 上安装 mysql 服务器的问题

...sudomysql_secure_installation。我收到错误消息:ERROR2002(HY000):无法通过套接字连接到本地MySQL服务器\ 查看详情

如何在 ubuntu 16.04 机器上安装和配置 HSQL DB

...天以来,我一直在尝试在我的机器上安装和配置它,但我无法配置和运行它。我在 查看详情

无法在 Ubuntu 16.04 中启动 Docker 服务

】无法在Ubuntu16.04中启动Docker服务【英文标题】:UnabletostartDockerServiceinUbuntu16.04【发布时间】:2016-09-1016:11:28【问题描述】:我一直在尝试在Ubuntu16.04上使用Docker(1.10),但安装失败,因为Docker服务没有启动。我已经尝试通过docker.i... 查看详情

在 Ubuntu 16.04 上安装 Cilk 时出现问题

】在Ubuntu16.04上安装Cilk时出现问题【英文标题】:ProblemduringCilkinstallationonUbuntu16.04【发布时间】:2020-02-2700:29:10【问题描述】:我尝试了两天在我的电脑上安装cilk。目前我正在尝试在Ubuntu16.04上安装它(因为Ubuntu18似乎存在问题... 查看详情

如何在 Ubuntu 16.04 上安装 PHPMyAdmin

】如何在Ubuntu16.04上安装PHPMyAdmin【英文标题】:HowtoinstallPHPMyAdminonUbuntu16.04【发布时间】:2016-08-2402:44:23【问题描述】:我是ubuntu操作系统的新手。我通过谷歌搜索在我的本地机器上安装了nginx服务器、PHP7.0.5和MySQL服务器版本5.7.... 查看详情

无法在 Hive 中实例化 metadata.SessionHiveMetaStoreClient(Ubuntu 16.04)

】无法在Hive中实例化metadata.SessionHiveMetaStoreClient(Ubuntu16.04)【英文标题】:Unabletoinstantiatemetadata.SessionHiveMetaStoreClientinHive(Ubuntu16.04)【发布时间】:2017-08-1207:38:08【问题描述】:我正在尝试在Ubuntu16.04上使用mysql设置hive2.3.0。我... 查看详情

在 Ubuntu 16.04 上安装谷歌云模块返回错误

】在Ubuntu16.04上安装谷歌云模块返回错误【英文标题】:InstallinggooglecloudmoduleonUbuntu16.04returnserror【发布时间】:2018-01-2319:19:09【问题描述】:我尝试在Ubuntu16.04上为python3安装谷歌云模块,但它显示permissionerror13在我的python环境Perm... 查看详情

Ubuntu 16.04 我卸载了 apache2 但现在无法重新安装

】Ubuntu16.04我卸载了apache2但现在无法重新安装【英文标题】:Ubuntu16.04Iuninstalledapache2butcan\'treinstallitnow【发布时间】:2019-05-1221:26:14【问题描述】:我在我设置的ubuntu16.04服务器上遇到了问题。我怀疑我在最初安装和配置apache2时... 查看详情

在 Ubuntu 16.04 上安装 libqwt6

】在Ubuntu16.04上安装libqwt6【英文标题】:Intallinglibqwt6onUbuntu16.04【发布时间】:2016-11-3007:23:47【问题描述】:祝你有美好的一天,我有一个程序要安装,它需要库libqwt6。我正在使用.deb包安装它。在以前的Ubuntu版本中,似乎可以... 查看详情

在 ubuntu 16.04 lts 上安装 numba 0.30.1

】在ubuntu16.04lts上安装numba0.30.1【英文标题】:Installnumba0.30.1onubuntu16.04lts【发布时间】:2017-06-2601:51:36【问题描述】:如何在Ubuntu16.04LTS上为Python3安装当前版本(0.30.1)的numba?我的Python版本是3.5.2,我安装了Ubuntu的准系统(我认为... 查看详情

Ubuntu 16.04 安装 ElasticSearch 5.x,启动失败

...ntu16.04时,我使用后续步骤安装ElasticSearch5.0.1或5.0.2,但ES无法启动。有谁知道如何在Ubuntu16.04或14.04上运行ES5.x?苏add- 查看详情

在安装 v0.6 的同时在 Ubuntu 16.04 上安装 Julia v0.5

】在安装v0.6的同时在Ubuntu16.04上安装Juliav0.5【英文标题】:InstallingJuliav0.5onUbuntu16.04whilev0.6isinstalled【发布时间】:2017-06-0811:26:49【问题描述】:我使用v0.6,但某些软件包在v0.6中不起作用(例如Interact.jl)。如何安装v0.5?我正在... 查看详情

无法在 python 中为 ubuntu 16.04 上的 libreoffice 导入 uno

】无法在python中为ubuntu16.04上的libreoffice导入uno【英文标题】:can\'timportunoinpythonforlibreofficeonubuntu16.04【发布时间】:2020-09-1909:32:00【问题描述】:我在ubuntu16.04上使用LO7.0.1.2和python3.7.6。已安装APSO,并且在LO中执行python脚本可以... 查看详情

在ubuntu16.04上安装有道词典

...来源:http://www.cnblogs.com/scplee/archive/2016/05/13/5489024.html在ubuntu16.04上安装有道词典主要是解决依赖问题,我们在配置文件中把依赖文件删除,就行了第一步:下载有道词典的.deb包第二步:创建youdao文件,然后把有道的源文件解压... 查看详情

sh在ubuntu16.04上安装saltstack(代码片段)

查看详情