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
Can't locate Mysql.pm in @INC (@INC contains
Re: Can't locate Mysql.pm in @INC (@INC contains
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
Re: Can't locate Mysql.pm in @INC (@INC contains
You don't need "use Mysql", all you need is:
use DBI;
use DBI;