背景
由于某种原因需要在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.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