csjoz11

导航

Mysql出现问题:mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object解决方案

Mysql出现问题:mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object解决方案

小虚竹

已于 2023-05-30 14:47:01 修改

阅读量3.6w
 收藏 31

点赞数 12
文章标签: mysql centos linux 1024程序员节
版权
❤️作者主页:小虚竹

❤️作者简介:大家好,我是小虚竹。Java领域优质创作者🏆,CSDN博客专家🏆,华为云享专家🏆,掘金年度人气作者🏆,阿里云专家博主🏆

❤️技术活,该赏

❤️点赞 👍 收藏 ⭐再看,养成习惯

PC端左侧加我微信,进社群,有送书等更多活动!

问题
初始化数据库时

mysqld --initialize --user mysql

 

报错:

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

执行这行命令报错了,原因是:新的服务器环境,上面很多依赖都没有,所以安装软件的时候遇到一大堆小问题,解决它很简单,它缺少啥就安装啥。

解决方案
yum install -y libaio.so.1

 

又报错了:

Errors during downloading metadata for repository ‘epel’:
Status code: 404 for http://archives.fedoraproject.org/pub/archive/epel/8/Everything/x86_64/repodata/repomd.xml (IP: **)
Error: Failed to download metadata for repo ‘epel’: Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

原因是:第三方的镜像站中均已移除CentOS 8的源,Centos 8版本已停止更新相应依赖导致的,下载新的yum源即可搞定。
解决方案:
备份之前的repo文件,命令:

mv /etc/yum.repos.d /etc/yum.repos.d.bak

创建源文件目录,命令:

mkdir -p /etc/yum.repos.d

下载新的yum源

curl https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo > /etc/yum.repos.d/Centos-vault-8.5.2111.repo

curl https://mirrors.aliyun.com/repo/epel-archive-8.repo > /etc/yum.repos.d/epel-archive-8.repo

如图所示操作:


再下载依赖:

yum install -y libaio.so.1

 


再安装

yum install -y libaio

提示成功后,初始化数据库:

mysqld --initialize --user mysql

 

扩展
————————————————

                            版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
                        
原文链接:https://blog.csdn.net/shi_hong_fei_hei/article/details/127136730

posted on 2024-05-08 00:57  csjoz11  阅读(751)  评论(0编辑  收藏  举报