PDA

View Full Version : MySQLHelper.pm message



sbjaerum
2006-06-16, 05:16
On my WinXP system with no external mysql server running, I always get this message when starting slimserver.pl:
2006-06-16 14:08:44.5708 DBI connect('hostname=127.0.0.1;port=9092','',...) failed: Can't connect to MySQL server on '127.0.0.1' (10061) at C:\slim\trunk\server/Slim/Utils/MySQLHelper.pm line 324

the reason is the following lines in the init function:
# The DB server might already be up.. if it didn't get shutdown last
# time. That's ok.
if (!$class->dbh) {

$class->startServer;
}

$class->dbh tries to connect to the server, but the server is not running, a connection is not possible, and the message above is written.

Steinar

Dan Sully
2006-06-16, 09:32
* sbjaerum shaped the electrons to say...

>$class->dbh tries to connect to the server, but the server is not
>running, a connection is not possible, and the message above is
>written.

Does this patch silence the error?

- return eval { DBI->connect($dsn) };
+ return eval { DBI->connect($dsn, undef, undef, { 'PrintError' => 0, 'RaiseError' => 0 }) };

-D
--
On second thought, let's not go to Camelot. It is a silly place.

sbjaerum
2006-06-16, 11:02
Does this patch silence the error?

- return eval { DBI->connect($dsn) };
+ return eval { DBI->connect($dsn, undef, undef, { 'PrintError' => 0, 'RaiseError' => 0 }) };



Yes, it does.
Thanks.