Can't locate Mysql.pm in @INC (@INC contains

Issues related to applications and software problems
Post Reply
Iqbal
Posts: 22
Joined: 2019/10/09 20:46:11

Can't locate Mysql.pm in @INC (@INC contains

Post by Iqbal » 2021/02/19 18:35:17

Hello,

I have installed mysql and perl-DBD-MySQL. As you can see here the terminal output:

[root@adeq scripts_db]# yum -y install perl-DBD-MySQL
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: bay.uchicago.edu
* centos-sclo-rh: mirror.steadfastnet.com
* centos-sclo-sclo: mirror.dal10.us.leaseweb.net
* epel: epel.mirror.constant.com
* extras: atl.mirrors.clouvider.net
* nux-dextop: li.nux.ro
* updates: mirror.ash.fastserv.com
Package perl-DBD-MySQL-4.023-6.el7.x86_64 already installed and latest version
Nothing to do
[root@adeq scripts_db]# mysql -u ametsecure -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 45
Server version: 8.0.23 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \q
Bye
[root@adeq scripts_db]# which mysql
/usr/bin/mysql



But when I ran a script it is giving me this error: Can't locate Mysql.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .)

Please help

sml
Posts: 305
Joined: 2020/01/17 09:01:44

Re: Can't locate Mysql.pm in @INC (@INC contains

Post by sml » 2021/02/19 19:08:37

Because it is mysql.pm

Code: Select all

$ rpm -ql perl-DBD-MySQL|fgrep /mysql.pm
/usr/lib64/perl5/vendor_perl/Bundle/DBD/mysql.pm
/usr/lib64/perl5/vendor_perl/DBD/mysql.pm

Whoever
Posts: 1361
Joined: 2013/09/06 03:12:10

Re: Can't locate Mysql.pm in @INC (@INC contains

Post by Whoever » 2021/02/20 06:25:34

You don't need "use Mysql", all you need is:

use DBI;

Post Reply