1、安装mysql时遇到如下问题:
[root@localhost mysql]# bin/mysqld --initialize --user=jxxchallenger
bin/mysqld: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory
mysqld 提示缺少libcrypt.so.1
2、使用ldd命令查看依赖
[root@localhost mysql]# ldd /opt/mysql/bin/mysqld
linux-vdso.so.1 (0x00007ffcd869f000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc177d03000)
libaio.so.1 => /lib64/libaio.so.1 (0x00007fc177cfe000)
libnuma.so.1 => /lib64/libnuma.so.1 (0x00007fc177cf0000)
libcrypt.so.1 => not found
libssl.so.1.0.0 => /opt/mysql/bin/libssl.so.1.0.0 (0x00007fc177a80000)
libcrypto.so.1.0.0 => /opt/mysql/bin/libcrypto.so.1.0.0 (0x00007fc177646000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fc17763e000)
librt.so.1 => /lib64/librt.so.1 (0x00007fc177634000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc17743b000)
libm.so.6 => /lib64/libm.so.6 (0x00007fc1772f5000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc1772db000)
libc.so.6 => /lib64/libc.so.6 (0x00007fc177115000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc177d3d000)
3、使用yum或dnf等安装命令查找依赖
[root@localhost mysql]# dnf search libxcrypt
上次元数据过期检查:0:25:18 前,执行于 2019年07月14日 星期日 18时10分12秒。
=========================== Name 精准匹配:libxcrypt ===========================
libxcrypt.x86_64 : Extended crypt library for descrypt, md5crypt, bcrypt, and
: others
libxcrypt.i686 : Extended crypt library for descrypt, md5crypt, bcrypt, and
: others
libxcrypt.x86_64 : Extended crypt library for descrypt, md5crypt, bcrypt, and
: others
======================= Name 和 Summary 匹配:libxcrypt ========================
libxcrypt-devel.x86_64 : Development files for libxcrypt
libxcrypt-devel.i686 : Development files for libxcrypt
libxcrypt-devel.x86_64 : Development files for libxcrypt
libxcrypt-static.i686 : Static library for -static linking with libxcrypt
libxcrypt-static.x86_64 : Static library for -static linking with libxcrypt
============================= Name 匹配:libxcrypt =============================
libxcrypt-compat.i686 : Compatibility library providing legacy API functions
libxcrypt-compat.x86_64 : Compatibility library providing legacy API functions
4、最后安装依赖
[root@localhost mysql]# dnf install libxcrypt-compat.x86_64
上次元数据过期检查:0:26:19 前,执行于 2019年07月14日 星期日 18时10分12秒。
依赖关系解决。
================================================================================
Package Architecture Version Repository Size
================================================================================
安装:
libxcrypt-compat x86_64 4.4.6-2.fc30 updates 93 k
事务概要
================================================================================
安装 1 软件包
总下载:93 k
安装大小:254 k
确定吗?[y/N]: y
下载软件包:
libxcrypt-compat-4.4.6-2.fc30.x86_64.rpm 17 kB/s | 93 kB 00:05
--------------------------------------------------------------------------------
总计 11 kB/s | 93 kB 00:08
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
准备中 : 1/1
安装 : libxcrypt-compat-4.4.6-2.fc30.x86_64 1/1
运行脚本: libxcrypt-compat-4.4.6-2.fc30.x86_64 1/1
验证 : libxcrypt-compat-4.4.6-2.fc30.x86_64 1/1
已安装:
libxcrypt-compat-4.4.6-2.fc30.x86_64
完毕!