in reply to How do I direct DBI::mysql to a particular mysql instance
you are accessing mysql through the Unix domain socket (i.e. /var/run/mysqld/mysqld.sock), not a TCP socket (i.e. port 3306).mysql -u first -p
Here's how to connect in each of these cases:
For more details, see the DBD::mysql documentation.# connect via the Unix domain socket my $dsn = "DBI:mysql:database=$db"; my $dbh = DBI->connect($dsn, ...); # connect via a TCP socket my $dsn = "DBI:mysql:database=$db;host=localhost;port=3309"; my $dbh = DBI->connect($dsn, ...);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I direct DBI::mysql to a particular mysql instance
by hazards (Initiate) on Jul 21, 2008 at 17:56 UTC |