debian 中的 Perl mysql 模块
我有两台服务器运行在 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.
我用 google 搜索了这个错误,发现我需要为 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.
我仍然收到相同的错误。有人可以帮我解决这个问题吗?我需要重新启动任何其他服务吗?
I have two servers running on redhat and debian. I am using a perl script for taking mysql backups and in redhat it is working fine. When I run it on debian, I get the following error:
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.
I googled this error and found that I need to install mysql driver for perl. I installed it using this command:
sudo apt-get install libdbd-mysql-perl
The response was as follows:
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.
Still I am getting the same error. Can someone help me on this? Do I need to restart any other service?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Mysql.pm 是旧的 DBI 之前的版本MySQL 接口。它已经过时多年,并且完全从 DBD-mysql dist(又名libdbd-mysql-perl) 在 2006 年。
您可以尝试安装旧副本,但最好将备份脚本移植到 DBI 和 DBD::mysql,或者寻找更新的备份脚本。
Mysql.pm was the old, pre-DBI interface to MySQL. It's been obsolete for years, and was dropped entirely from the DBD-mysql dist (a.k.a. libdbd-mysql-perl) in 2006.
You can try to install an old copy, but you're better off porting the backup script to DBI and DBD::mysql, or finding a newer backup script.