debian 中的 Perl mysql 模块

发布于 2025-01-06 15:20:45 字数 787 浏览 2 评论 0原文

我有两台服务器运行在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

偏爱你一生 2025-01-13 15:20:45

Mysql.pm 是旧的 DBI 之前的版本MySQL 接口。它已经过时多年,并且完全从 DBD-mysql dist(又名libdbd-mysql-perl) 在 2006 年。

您可以尝试安装旧副本,但最好将备份脚本移植到 DBIDBD::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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文