mariadb 10.4.18 설치시 libncurses.so.5 에러문제 해결

Rocky linux 8에서 mariadb 10.4.18을 설치하다가
에러가 나서 확인을 해보니

1. 에러발생

/data/mariadb/bin/mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
Password update failed!

libncurses.so.5: cannot open shared object file: No such file or directory

라이브러리 파일이 없다는 메시지였다.

실제 파일이 없는지 확인을 해보니

find /usr/lib/ -name *ncurses*

실제 파일이 없었다.

Mariadb 설치관련 에러를 jira 등에서 좀 구글링 해보니

RedHat 8(=Rocky linux 8) 이상에서는 libncurses.so.5 바이너리를 기본적으로 사용할 수 없다는 것을 알게되었다.
그런데 mariadb 10.4.18은 libncurses.so.5 가 필요하다보니 설치중 에러가 난 것이었다.

다음은 OS 플랫폼에 따라 사용 가능한 종속 라이브러리 버전을 정리한 것이다.

RHEL 7에는 libncurses.so.5가 기본 라이브러리로 있습니다.
RHEL 8에는 libncurses.so.6.1이 기본 라이브러리로 있습니다. 그러나 libncurses.so.5 는 RedHat Repository에서도 다운로드할 수 있습니다.
RHEL 9에는 libncurses.so.6.2가 기본값으로 있습니다.

yum update 레파지토리를 변경해서 libncurses.so.5을 다운받아야할까?
굳이 그렇게 할 필요는 없다.

이제 문제를 해결해보자.

2. 문제해결

일단 ncurses관련 라이브러리 파일을 최신화한다.

yum install -y ncurses*

그런데 yum 업데이트가 안되고 아래와 같은 에러가 난다면

[root@localhost bin]# yum install -y ncurses*
Rocky Linux 8 - AppStream 0.0 B/s | 0 B 00:03
Errors during downloading metadata for repository 'appstream':
- Curl error (60): Peer certificate cannot be authenticated with given CA certificates for https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=AppStream-8 [SSL certificate problem: self signed certificate in certificate chain]
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: Curl error (60): Peer certificate cannot be authenticated with given CA certificates for https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=AppStream-8 [SSL certificate problem: self signed certificate in certificate chain]
[root@localhost bin]#


solution)

sudo vi /etc/yum.conf
---------------------------------
sslverify=false


로 하고 다시 yum 업데이트를 시도하면 아래와 같이 install을 수행할 수 있다

[root@localhost bin]# yum install -y ncurses*
Rocky Linux 8 - AppStream 5.0 MB/s | 12 MB 00:02
Rocky Linux 8 - BaseOS 3.5 MB/s | 7.2 MB 00:02
Rocky Linux 8 - Extras 17 kB/s | 14 kB 00:00
Last metadata expiration check: 0:00:01 ago on Thu 26 Oct 2023 01:51:37 AM KST.
...
..
.
[root@localhost yum.repos.d]# rpm -q ncurses
ncurses-6.1-9.20180224.el8.x86_64

그이후 라이브러리는 보통 상위버전은 하위를 호환하기 때문에
libncurses.so.6.1 을 심볼릭 링크를 걸어서 libncurses.so.5 파일을 생성해주면 된다.

ln -s /usr/lib64/libncurses.so.6.1 /usr/lib64/libncurses.so.5
ln -s /usr/lib64/libtinfo.so.6.1 /usr/lib64/libtinfo.so.5
ln -s /usr/lib64/libform.so.6.2 /usr/lib64/libform.so.5

3. MariaDB 설치

/* mysql_secure_installation 실행 */
[root@localhost bin]# ./mysql_secure_installation --basedir=/svc/mariadb --socket=/tmp/mysql.sock
print: /data/mariadb/bin/my_print_defaults

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] n
... skipping.

You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
... skipping.

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@localhost bin]#

설치 완료!

에러없이 rocky linux 8에 MariaDB 설치를 마쳤다.

끝.

Leave a Comment