However, DBI->connect("DBD:MariaDB:database=xxx", $user, $pass); connects without problem.


So I guess that DBI->connect("DBD:MariaDB:database=... is using some form of default driver.

It works only by accident, or because DBI is quite relaxed regarding the data source argument to connect(). The DBI documentation clearly states:


$dbh = DBI->connect($data_source, $username, $password) or die $DBI::errstr; $dbh = DBI->connect($data_source, $username, $password, \%attr) or die $DBI::errstr;

The $data_source value must begin with "dbi:driver_name:". The driver_name specifies the driver that will be used to make the connection. (Letter case is significant.)



Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^5: DBI placeholders for spatial data by afoken
in thread DBI placeholders for spatial data by Bod

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":