fionbarr has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to connect to MySQL with this code:
I am getting this error: 'Unknown MYSQL server host ' localhost' <11004>'my $hostname = "localhost"; my $db_name = "test"; my $dsn = "DBI:mysql:host=$hostname; database=$db_name"; my $dbh = (DBI->connect($dsn, "ttt", "nancy613", {PrintError => 0, RaiseError => 1} ));
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: connect to DBD::MYSQL
by Tux (Canon) on Jan 31, 2014 at 21:06 UTC | |
by fionbarr (Friar) on Jan 31, 2014 at 21:11 UTC | |
by Tux (Canon) on Jan 31, 2014 at 21:26 UTC | |
by fionbarr (Friar) on Feb 01, 2014 at 16:43 UTC | |
by karlgoethebier (Abbot) on Feb 01, 2014 at 19:10 UTC | |
Re: connect to DBD::MYSQL
by Generoso (Prior) on Feb 02, 2014 at 06:31 UTC | |
Re: connect to DBD::MYSQL
by FloydATC (Deacon) on Feb 01, 2014 at 09:38 UTC | |
by karlgoethebier (Abbot) on Feb 01, 2014 at 11:48 UTC |
Back to
Seekers of Perl Wisdom