gpt4 book ai didi

mysql - 无法打开/proc/net/unix : No such file or directory//invoke-rc. d: 无法确定当前运行级别

转载 作者:行者123 更新时间:2023-12-03 09:51:34 26 4
gpt4 key购买 nike

我正在尝试在我的 wsl Ubuntu 18.04 上重新安装 mysql-server。

(我在 Windows 10 上有 MySQL 服务器,但在端口 3307 上。如果这很重要,我想知道,但以防万一!)

我不能 sudo service mysql start也不是 sudo /etc/init.d/mysql start它回来了

No directory, logging in with HOME=/
mkdir: cannot create directory ‘//.cache’: Permission denied
-su: 19: /etc/profile.d/wsl-integration.sh: cannot create //.cache/wslu/integration: Directory nonexistent [Failed]

我在 Ubuntu 中搜索了有关重新安装 mysql 的信息,并按照以下步骤操作。
- https://github.com/microsoft/WSL/issues/1761
sudo su
apt-get remove --purge 'mysql*'
apt-get autoremove
apt-get autoclean
rm -f /etc/mysql /var/lib/mysql
apt-get install mysql-server

但是在尝试 apt-get install mysql-server我得到了下面的错误。
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)
Cannot open /proc/net/unix: No such file or directory
Cannot stat file /proc/1/fd/5: Operation not permitted
Cannot stat file /proc/1/fd/10: Operation not permitted
Cannot stat file /proc/1/fd/6: Operation not permitted
Cannot stat file /proc/5/fd/7: Operation not permitted
Cannot stat file /proc/5/fd/10: Operation not permitted
Cannot stat file /proc/5/fd/5: Operation not permitted
Cannot stat file /proc/843/fd/7: Operation not permitted
Cannot stat file /proc/843/fd/10: Operation not permitted
Cannot stat file /proc/843/fd/5: Operation not permitted
dpkg: error processing package mysql-server-5.7 (--configure):
installed mysql-server-5.7 package post-installation script subprocess 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.

我一直在谷歌搜索 Cannot open /proc/net/unix: No such file or directoryinvoke-rc.d: could not determine current runlevel问题,但找不到此问题的正确解决方案。

如果你能给我一些建议,我真的很感激。谢谢!

最佳答案

当我查看日志文件 /var/log/mysql/error.log我发现

[ERROR] [MY-012585] [InnoDB] Linux Native AIO interface is not supported on this platform. Please check your OS documentation and install appropriate binary of InnoDB.
我通过创建一个新的配置文件 /etc/mysql/conf.d/no_native_aio.conf 禁用了 Native AIO。 :
[mysqld]
innodb_use_native_aio = 0
然后我能够像这样启动数据库服务器:
sudo service mysql start
我也不得不跑
 sudo mysql_secure_installation
为 root 用户设置密码。
我不得不欺骗 dpkg相信安装后脚本已经运行
成功通过:
  • 添加 exit 0作为 /var/lib/dpkg/info/mysql-server-8.0.postinst 中的第二行
  • 运行 sudo dpkg --configure -a
  • 删除 exit 0来自 /var/lib/dpkg/info/mysql-server-8.0.postinst
  • 关于mysql - 无法打开/proc/net/unix : No such file or directory//invoke-rc. d: 无法确定当前运行级别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60648355/

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