无法安装MySQL - libaio.so.1:无法打开共享对象文件:没有这样的文件或目录 - 使用持久性进行实时安装

问题描述 投票:0回答:3

我决定注册askubuntu.com,因为我真的需要专家的建议:我用mkusb制作了Ubuntu 16.10的持久USB Live安装,因为我想拥有一个便携式开发环境。一切都很顺利,我现在正在写Live。

现在的问题是:我设法安装了apache2,但是经过几个小时的网络搜索,以及在这个网站上,我仍然无法正常安装MySQL服务器。重新执行多次安装后,我继续收到此错误:

 Setting up mysql-server-5.7 (5.7.17-0ubuntu0.16.10.1) ...
ERROR: Unable to start MySQL server:
mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips on fixing common upgrade issues.
Once the problem is resolved, run apt-get --fix-broken install to retry.
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script 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.
                          Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

如果我跑

sudo mysqld --initialize

终端仍在报告

mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

所以我想也要搜索这个“libaio.so.1”,然后我完成了安装库“libaio1”和“libaio-dev”(看起来是一样的)。但是,即使正确安装了这些库,结果也没有改变。

这是因为我在LiveUSB吗?或者是否有另一个安装/使MySQL识别的程序(因为它已经安装,我验证了该文件存在)libaio.so.1?

我真的希望你能帮助我,因为我尝试了一切。我提前为这个问题中可能出现的任何错误道歉。谢谢。

哦,我有一个unanswered duplicate on the Ubuntu community,所以如果没有答案,请随时删除这个问题。再次提前谢谢你。

mysql ubuntu usb-drive
3个回答
2
投票

经过多个小时的研究,我发现问题不在于LiveUSB或图书馆本身。问题是AppArmor,他阻止MySQL使用该库。 So I disabled it

sudo /etc/init.d/apparmor stop
sudo /etc/init.d/apparmor teardown
sudo update-rc.d -f apparmor remove

而且一种不那么正统的方式,我完全删除了AppArmor,以防止将来出现以下问题:

sudo apt-get purge apparmor

然后我卸载并重新安装MySQL服务器完美无缺。有用!


0
投票

也许你应该卸载mysql并使用这些命令再次安装它

删除mysql -

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean

重新安装

sudo apt-get update
sudo apt-get install mysql-server
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation

0
投票

如果您在安装MariaDB时到达此处,则可以使用以下命令安装libaio1。上述解决方案对我不起作用

sudo apt-get install libaio1

参考是here

© www.soinside.com 2019 - 2024. All rights reserved.