# Getting errors with MySQL inside of Perl



## dpalme (Dec 2, 2013)

I'm running Perl 5.16 and when I attempt to run the following code: 

```
#!/usr/bin/perl -w
use DBI;
$dbh = DBI->connect('dbi:mysql:DATABASENAME', 'USERNAME','PASSWORD');
```
(and yes I replaced the values for the database name, username and password) I get the following error message in the log file: 

```
[Sun Dec 01 18:55:09 2013] [error] [client xx.xx.xxxx.107] install_driver(mysql) failed: Can't locate
DBD/mysql.pm in @INC (@INC contains: /usr/local/lib/perl5/5.16/BSDPAN /usr/local/lib/perl5/site_perl/
5.16/mach /usr/local/lib/perl5/site_perl/5.16 /usr/local/lib/perl5/5.16/mach /usr/local/lib/perl5/5.1
6 .) at (eval 6) line 3.
```

I thought it might be an install issue, but I'm not sure so I figured I better start asking before I screw things up.


----------



## junovitch@ (Dec 2, 2013)

Is databases/p5-DBD-mysql or the appropriate version Perl module installed?


----------



## dpalme (Dec 2, 2013)

I'll have to check and see, I'll be back shortly.


----------



## dpalme (Dec 2, 2013)

*T*hat did it, I didn't have version 51 installed and so it was burping.

Thanks for the help my friend 
 :beergrin


----------

