Perl doesn't know this because my.conf can be in a different place, you might not have a local mysql server, you might not want to connect to the local mysql, or you might have more than one local mysql deamon.
In other words; you need to supply the connection info yourself, because it's no use guessing.
update: the DBD::mysql manual states:
$dsn = "DBI:mysql:database=$database;host=$hostname;port=$port";
$dbh = DBI->connect($dsn, $user, $password);
| [reply] |
ok, so always connect to a host and port and not via the deafult perl socket
Thanks Luca
| [reply] |
Or use DBI->connect() with the "mysql_socket" option. See the DBD::mysql manual.
| [reply] |
You can appened "mysql_read_default_group=$somegroup" to your
connect string, and then DBD::mysql should read your my.conf.
my.conf is not being read because the mysql client libraries
that DBD::mysql uses don't seem to want to read the my.conf
file unless read_default_group is specified. A future version of DBD::mysql will default to
"mysql_read_default_group=dbd_mysql" if no other group is specified.
| [reply] |
Are you sure your mysql server is up and running without a problem? I've also seen that message when the service is hung/crashed/stopped/etc. | [reply] |