新装的 mariadb-10.6.x, 为 root 用户设置密码,执行 mysql_secure_installation 时报:

1
2
3
4
5
6
7
8
9
10
11
12
[root@VM-8-3-centos mysql]# mysql_secure_installation

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):
/usr/local/mysql/bin/mariadb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
OK, successfully used password, moving on...
解决方法

使用 dnf 安装 ncurses-devel:

1
dnf install -y ncurses-compat-libs