in reply to Re: how to test a connection with mysql db
in thread how to test a connection with mysql db

If I try to connect, and it fails, because this server is off line, my perl-script generates a message (to screen!!) that it failed. I don't want this message to screen.
  • Comment on Re^2: how to test a connection with mysql db

Replies are listed 'Best First'.
Re^3: how to test a connection with mysql db
by moot (Chaplain) on Apr 15, 2005 at 21:50 UTC
    Pass PrintError => 0 as an option in your connect string. From perldoc DBI:
    The "\%attr" parameter can be used to alter the default settings of "PrintError", "RaiseError", "Auto­ Commit", and other attributes. For example: $dbh = DBI->connect($data_source, $user, $pass, { PrintError => 0, AutoCommit => 0 });

    Update: Fixed bogus entity; added 'perldoc'.