-bash: /usr/local/mysql/scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file or directory

时间:2022-05-22 20:42:53

安装 MySQL 初始化时,报错如下:

[root@hcdb1 ~]# /usr/local/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/data/mysql/3307/data --user=mysql
-bash: /usr/local/mysql/scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file or directory

 

原因:缺 perl perl-devel包。

 

解决办法:安装上即可:

 yum install -y perl perl-devel