OS: Mac 10.12.1, mysql 5.7.15
perl -e 'print $];' 5.016000
Error message:
Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at ./testDBConnection.pl line 8. BEGIN failed--compilation aborted at ./testDBConnection.pl line 8.
Source Code:
#!/usr/bin/perl
#use lib '/usr/bin/cpan';
use strict;
use FileHandle;
use File::Spec;
use DBI;
use DBD::mysql;
When I run: cpan DBD::mysql
Reading '/Users/user/.cpan/Metadata'
Database was generated on Fri, 18 Nov 2016 19:41:02 GMT
DBD::mysql is up to date (4.039).
When I run: perldoc -lm DBI DBD::mysql
/Users/user/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/DBI.pm
/Users/user/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/DBD/mysql.pm
Any suggestions?