in reply to Re: Connect to MySQL database (on Ubuntu Server) using Perl
in thread Connect to MySQL database (on Ubuntu Server) using Perl
Thanks for the reply. I've changed my code to this:
#!/usr/bin/perl use strict; use warnings; use DBI; my $username='username'; my $pass='password'; my $db='database_name'; my $host='hostname'; my $dbh = DBI->connect( "dbi:mysql:database=$db:$host", $username, $pa +ss, { 'PrintError' => 1, 'RaiseError' => 1 } );
I'm still getting an error: Unknown MySQL server host 'hostname' (2) at ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Connect to MySQL database (on Ubuntu Server) using Perl
by moritz (Cardinal) on Jul 25, 2012 at 12:45 UTC | |
by liverpaul (Acolyte) on Jul 25, 2012 at 12:57 UTC |