首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法打开/proc/net/unix:没有这样的文件或目录// invoke-rc.d:无法确定当前的运行级别

无法打开/proc/net/unix:没有这样的文件或目录// invoke-rc.d:无法确定当前的运行级别
EN

Stack Overflow用户
提问于 2020-03-12 05:57:56
回答 2查看 2.6K关注 0票数 5

我正试图在我的wsl Ubuntu 18.04上重新安装mysql服务器。

(我在Windows 10上有MySQL服务器,但在端口3307上。如果这很重要,那就去看看吧,以防万一!)

我不能sudo service mysql startsudo /etc/init.d/mysql start,它又回来了

代码语言:javascript
运行
复制
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的信息,并遵循了以下步骤。

代码语言:javascript
运行
复制
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时,我得到了下面的错误。

代码语言:javascript
运行
复制
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问题,但没有找到正确的解决方案。

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

EN

回答 2

Stack Overflow用户

发布于 2020-08-12 11:42:56

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

代码语言:javascript
运行
复制
[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,我禁用了本机AIO的使用

代码语言:javascript
运行
复制
[mysqld]
innodb_use_native_aio = 0 

然后,我能够像这样启动数据库服务器:

代码语言:javascript
运行
复制
sudo service mysql start

我还得跑

代码语言:javascript
运行
复制
 sudo mysql_secure_installation

若要设置根用户的密码,请执行以下操作。

我不得不欺骗dpkg,让它相信postinstall脚本已经成功运行了:

/var/lib/dpkg/info/mysql-server-8.0.postinst

  • running sudo dpkg --configure -a

  • removing中的
  • 添加exit 0作为第二行-- /var/lib/dpkg/info/mysql-server-8.0.postinst

中的exit 0

票数 2
EN

Stack Overflow用户

发布于 2021-06-28 01:37:28

这将是一个WSL1与WSL2的问题。/proc目录没有完全填充WSL1。要检查您的版本运行(从powershell) wsl -l -v。如果它没有提供任何版本信息,那么您就在WSL1上了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60648355

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档