CentOS7安装MySQL8.0.33失败原因

背景

由于某种原因需要在Centos7上安装MySQL8做测试

环境

系统:Centos7
系统信息:

[xxx@localhost ~]$ uname -a
Linux localhost.localdomain 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

MySQL版本:8.0.33
因此对应的版本如下图应该都可以
MySQL下载官网
截图来自官网
所以我选择x86,64bit最新版,很合理

问题

在执行mysql这个文件时会报错

[root@localhost mysql8]# mysql --version
mysql: error while loading shared libraries: libncurses.so.6: cannot open shared object file: No such file or directory

安装libncurses.so.6时也会找不到

已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.raystedman.org
 * extras: ohioix.mm.fcix.net
 * updates: or-mirror.iwebfusion.net
没有可用软件包 libncurses6。

最先想到的是软件源没有及时更新,更新软件源后还是找不到
于是想着网上下载后,手动安装libncurses.so.6
结果如下图所示libncurses.so.6不支持Centos7
libncurses.so.6包下载地址
libncurses.so.6下载页面截图
如下图libncurses.so.5支持Centos7
在这里插入图片描述到此找到原因
综合上述原因可以判断glibc依赖libncurses.so
于是根据MySQL官网下载的选项问ChatGPT

:glibc2.17依赖libncurses.so.6吗?
ChatGPT
Yes, glibc2.17 depends on libncurses.so.6.
The GNU C Library (glibc) is a core library for C programming language, and it depends on various other libraries, including libncurses. In particular, glibc2.17 version requires libncurses.so.6 library to function properly.
So, if you are facing an issue with glibc2.17 and seeing an error message related to libncurses.so.6, it is likely that the library is missing or not installed on your system. You can refer to my previous response on how to install the library.

:glibc2.12依赖libncurses.so.6吗?
ChatGPT:Yes, glibc2.12 depends on libncurses.so.6.
The GNU C Library (glibc) is a core library for the C programming language, and it depends on various other libraries, including libncurses. In particular, glibc2.12 version requires libncurses.so.6 library to function properly.
So, if you see an error message related to libncurses.so.6 while running an application that depends on glibc2.12, it is likely that the library is missing or not installed on your system. You can refer to my previous response on how to install the library.

:glibc2.17依赖libncurses.so.5吗?
ChatGPT
No, glibc2.17 does not depend on libncurses.so.5.
The GNU C Library (glibc) is a core library for the C programming language, and it depends on various other libraries, including libncurses. However, the specific version of the libncurses library that glibc depends on can vary depending on the version of glibc and the operating system being used.
In general, glibc2.17 requires libncurses.so.6 library to function properly, not libncurses.so.5. So if you see an error message related to libncurses.so.5 while running an application that depends on glibc2.17, it is likely that the application itself is linked against libncurses.so.5 instead of libncurses.so.6. In this case, you may need to reinstall or recompile the application to link against the correct version of the library.

:glibc2.12依赖libncurses.so.5吗?
ChatGPT:Yes, glibc2.12 depends on libncurses.so.5.
The GNU C Library (glibc) is a core library for the C programming language, and it depends on various other libraries, including libncurses. In particular, glibc2.12 version requires libncurses.so.5 library to function properly.
So, if you see an error message related to libncurses.so.5 while running an application that depends on glibc2.12, it is likely that the library is missing or not installed on your system. You can install the library using your system’s package manager. For example, on a CentOS or RedHat system, you can run:
sudo yum install ncurses-libs
On a Debian or Ubuntu system, you can run:
sudo apt-get install libncurses5
Once the library is installed, the application that depends on glibc2.12 should be able to run without any issues.

结论

由于Centos7不支持libncurses.so.6,因此无法安装使用glic2.17以上的MySQL8
所以Centos7只能选择下图中glibc2.12版本的MySQL8
截图来自官网

  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值