在共享主机上运行此代码,该主机具有本地安装的perl和通过perlbrew安装的模块。它工作了几个星期。有一天,它开始用这个输出死亡:
/home/xxxx/perl5/perlbrew/perls/perl-5.16.2/bin/perl tweet.pl
install_driver(mysql) failed: Can't load '/home/xxxx/perl5/perlbrew/perls/perl-5.16.2/lib/site_perl/5.16.2/x86_64-linux/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.15: cannot open shared object file: No such file or directory at /home/xxxx/perl5/perlbrew/perls/perl-5.16.2/lib/5.16.2/x86_64-linux/DynaLoader.pm line 190.
at (eval 27) line 3.
Compilation failed in require at (eval 27) line 3.
Perhaps a required shared library or dll isn't installed where expected
at subroutines.pm line 3.
代码未更改。我运行脚本的方式也没有改变。由于我正在运行共享主机,我不知道服务器上可能更新或更改了什么,但是perl已安装到我的主目录中,我正在使用的所有模块也是如此。
它看起来像是libmysqlclient的问题。您正在运行什么发行版?
如果您运行的是 Debian(based),请尝试 "sudo apt-get purge libmysqlclient libmysqlclient-dev",然后尝试 "sudo apt-get install libmysqlclient libmysqlclient-dev"。