- Linux安装mysql8在初始化数据库mysql时失败,报错初始化msyql报错:mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
- 这个是yum源的问题,需要更新yum的源
- 解决方法
安装libaio: 执行:
yum -y install libaio
如果yum报错,则定位到:
/etc/yum.repos.d
重命名文件:
rename ‘.repo’ ‘.repo.bak’ /etc/yum.repos.d/*.repo
下载新的yum源文件
wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo
wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo
替换源地址
sed -i ‘s/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g’ /etc/yum.repos.d/Centos-vault-8.5.2111.repo
sed -i ‘s/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g’ /etc/yum.repos.d/epel-archive-8.repo
重新创建缓存
yum clean all
yum makecache
最后执行
yum install