msyql 登录 报错:error while loading shared libraries: libtinfo.so.5

迁移完mysql之后发现报错,解决过程如下:

报错信息:

[root@cwiki ec2-user]# /usr/local/mysql/bin/mysql -u root -p -h127.0.0.1
/usr/local/mysql/bin/mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

原因是 mysql 在执行时加载了 libtinfo.so.5 库文件,系统环境中缺少该库文件导致;

解决方法:

[root@cwiki ec2-user]# find / -name "libtinfo.so*"
/usr/lib64/libtinfo.so.6.0
/usr/lib64/libtinfo.so.6
[root@cwiki ec2-user]# ln -s /usr/lib64/libtinfo.so.6 /usr/lib64/libtinfo.so.5

创建高版本的软连接到低版本即可;一般可以解决该问题

error while loading shared libraries: libncursesw.so.5
该报错信息也可这样解决

[root@cwiki ec2-user]# /usr/local/mysql/bin/mysql -u root -p -h127.0.0.1
/usr/local/mysql/bin/mysql: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory
[root@cwiki ec2-user]# find / -name 'libncursesw.so*'
/usr/lib64/libncursesw.so.6
/usr/lib64/libncursesw.so.6.0
[root@cwiki ec2-user]# ln -s /usr/lib64/libncursesw.so.6 /usr/lib64/libncursesw.so.5
posted @ 2022-11-03 10:12  Star-Hitian  阅读(634)  评论(0编辑  收藏  举报