摘要:Mysql出现问题:error while loading shared libraries: libaio解决方案。 本文分享自华为云社区《Mysql出现问题:error while loading shared libraries: libaio解决方案》,作者: 小虚竹。
问题
初始化数据库时- 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
复制代码 再安装提示成功后,初始化数据库:- mysqld --initialize --user mysql
复制代码
点击关注,第一时间了解华为云新鲜技术~
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作! |