❤️作者主页:小虚竹
❤️作者简介:大家好,我是小虚竹。Java领域优质创作者????,CSDN博客专家????,华为云享专家????,掘金年度人气作者????,阿里云专家博主????
❤️技术活,该赏
❤️点赞 ???? 收藏 ,养成习惯
初始化数据库时
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