Reputation: 49105
I have a perl application that uses a MySQL backend.
How do I verify that the MySQL and database drivers are accessible?
I'm currently doing the following, but I don't know if it is actually a sufficient test -- I'd hate to find out six months down the line that I'm not doing the right test:
use Test::More;
BEGIN { use_ok('DBI'); }
BEGIN { use_ok('DBD::mysql'); }
done_testing();
Upvotes: 2
Views: 123
Reputation: 7392
This is enough to check that connection will be available from Perl side. If you want to check if mysql server is available, you need to connect to it.
P.S. You can also add version checking for DBD::mysql. For ex. 4.001 fixes serious bug in utf8 support.
Upvotes: 2