Linux安装Mysql报错:mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object

Ubuntu上使用二进制安装数据库时出现了如下问题:mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

解决方案

查看程序运行所需要的库文件

[21:22:33][root@ubuntu-11-22 ~]# ldd  /usr/local/mysql/bin/mysql
	linux-vdso.so.1 (0x00007ffe46b89000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff224cb2000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff224cad000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff224ca8000)
	libncurses.so.5 => /lib/x86_64-linux-gnu/libncurses.so.5 (0x00007ff224c80000)
	libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff224a54000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff22496d000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff22494b000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff224722000)
	libtinfo.so.5 => not found
	/lib64/ld-linux-x86-64.so.2 (0x00007ff224cbe000)
[21:22:44][root@ubuntu-11-22 ~]# 

通过我们的ldd命令发现未找到 libtinfo.so.5 not found.文件

查询libtinfo.so开头的文件

[21:25:27][root@ubuntu-11-22 ~]# find  / -name 'libtinfo.*'
/snap/core20/1974/usr/lib/x86_64-linux-gnu/libtinfo.so.6
/snap/core20/1974/usr/lib/x86_64-linux-gnu/libtinfo.so.6.2
/snap/core20/2182/usr/lib/x86_64-linux-gnu/libtinfo.so.6
/snap/core20/2182/usr/lib/x86_64-linux-gnu/libtinfo.so.6.2
/usr/lib/x86_64-linux-gnu/libtinfo.so.6.3
/usr/lib/x86_64-linux-gnu/libtinfo.so.6
[21:25:32][root@ubuntu-11-22 ~]# 

发现只有6版本的库,这里我们便有了解决方案,利用我们的软连接让5指向6

创建软连接

这个操作的意思是当需要用到 libtinfo.so.5 时去调用libtinfo.so.6.2

ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6.3 /usr/lib/x86_64-linux-gnu/libtinfo.so.5
[21:27:22][root@ubuntu-11-22 ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.50 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

  • 16
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
这个错误提示表明在加载MySQL时缺少libtinfo.so.5共享库文件。有几种方法可以解决这个问题。 方法一是安装缺少的包。根据引用和的信息,可以使用以下命令安装libtinfo.so.5包: sudo yum install ncurses-compat-libs 方法二是复制或创建软链接。根据引用的信息,可以使用以下命令复制或创建软链接: sudo cp /lib64/libtinfo.so.6 /lib64/libtinfo.so.5 或者 sudo ln -s /lib64/libtinfo.so.6 /lib64/libtinfo.so.5 这样做可以将libtinfo.so.6复制为libtinfo.so.5,或者创建一个指向libtinfo.so.6的软链接libtinfo.so.5。 以上两种方法都可以解决缺少libtinfo.so.5共享库文件的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such](https://blog.csdn.net/llliuhuiii/article/details/108808567)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *3* [mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file](https://blog.csdn.net/z13615480737/article/details/126817324)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值