[Bioperl-l] problem with t/LocalDB/SeqFeature.t when host ne localhost

Dan Bolser dan.bolser at gmail.com
Fri Jul 31 08:13:45 EDT 2009


Whenever I try to do the Bio::DB::GFF or Bio::DB::SeqFeature::Store
live database tests:

  - will run tests with database driver 'mysql' and these settings:
    Database test
    Host     our.mysql.host
    DSN      dbi:mysql:database=test;host=our.mysql.host
    User     me
    Password secret

I get the following error:

DBI connect('database=test','',...) failed: Can't connect to local
MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at
Bio/DB/SeqFeature/Store/DBI/mysql.pm line 212
sh: -user: command not found

The clue is the sh error that follows. The contents of the
t/LocalDB/SeqFeature_mysql.t file looks like this:

system '/usr/bin/perl t/LocalDB/SeqFeature.t -adaptor DBI::mysql
-create 1 -temp 1 -dsn dbi:mysql:database=test;host=our.mysql.host
-user me -password secret';

I tried the following diff to 'work around' the problem created by the
';' character in the dsn:

diff -u  t/LocalDB/SeqFeature.t~  t/LocalDB/SeqFeature.t
--- t/LocalDB/SeqFeature.t~     2009-05-11 15:22:07.000000000 +0100
+++ t/LocalDB/SeqFeature.t      2009-07-31 12:56:53.554227455 +0100
@@ -25,7 +25,7 @@
 @args = (-adaptor => 'memory') unless @args;

 SKIP: {
-my $db = eval { Bio::DB::SeqFeature::Store->new(@args) };
+my $db = eval { Bio::DB::SeqFeature::Store->new(-adaptor =>
"DBI::mysql", -create => 1, -temp => 1, -dsn =>
"dbi:mysql:database=test;host=our.mysql.host", -user => "me",
-password => "secret") };
 skip "DB load failed? Skipping all! $@", (TEST_COUNT - 2) if $@;

However, running the above script creates the following error:

DBD::mysql::db do failed: BLOB/TEXT column 'tag' used in key
specification without a key length at
Bio/DB/SeqFeature/Store/DBI/mysql.pm line 450.
ok 3 # skip DB load failed? Skipping all!
# -------------------- EXCEPTION --------------------
# MSG: BLOB/TEXT column 'tag' used in key specification without a key length
# STACK Bio::DB::SeqFeature::Store::DBI::mysql::_create_table
# STACK Bio::DB::SeqFeature::Store::DBI::mysql::init_tmp_database
# STACK Bio::DB::SeqFeature::Store::DBI::mysql::init
# STACK Bio::DB::SeqFeature::Store::new Bio/DB/SeqFeature/Store.pm:360
# STACK (eval) t/LocalDB/SeqFeature.t:28
# STACK toplevel t/LocalDB/SeqFeature.t:28
# -------------------------------------------

I'm not sure how to proceed from here.

Thanks for any hints,


More information about the Bioperl-l mailing list