我有两台服务器运行在 redhat 和 debian 上。我正在使用 perl 脚本进行 mysql 备份,在 redhat 中它工作正常。当我在 debian 上运行它时,出现以下错误:
Can't locate Mysql.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at ./dbbackup.pl line 15.
我搜索了这个错误,发现我需要为 perl 安装 mysql 驱动程序。我使用这个命令安装它:
sudo apt-get install libdbd-mysql-perl
响应如下:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libdbd-mysql-perl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 189 not upgraded.
我仍然遇到同样的错误。有人可以帮我吗?我需要重新启动任何其他服务吗?
最佳答案
Mysql.pm是旧的、DBI 之前的 MySQL 接口(interface)。它已经过时多年,并且完全从 DBD-mysql 中删除。 2006 年的 dist(又名 libdbd-mysql-perl)。
您可以尝试安装旧副本,但最好将备份脚本移植到 DBI和 DBD::mysql ,或寻找更新的备份脚本。
关于mysql - debian 中的 Perl mysql 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9323845/