Hi all i am new to the DBI .
when i am trying to connect to mysql using perl script i am getting the following error
Can't connect to data source '$dsn' because I can't work out what driver to use (it doesn't seem to contain a 'dbi:driver:' prefix and the DBI_DRIVER env var is not set)
here is the way i am tryng to connect
-
use strict;
-
-
use DBI;
-
use DBD::mysql;
-
-
my $drh = DBI->install_driver("mysql");
-
-
my $dsn = 'DBI:mysql:my_database:localhost';
-
my $dbh = DBI->connect('$dsn', 'root', '12345678',);
-