On Wed, 26 Nov 2008 12:36:28 -0700, Anthony DeMatteis
<[EMAIL PROTECTED]> wrote:

> I've been told that there is a way to be
> specific on what version/install of mysql that DBI uses.

Yes you can supply the port number in the DBI connection string. Note that
this only works when you're connecting via TCP/IP. Also note that there is
a long-standing bug whereby all connections to 'localhost' are forced to
use a local socket instead of TCP/IP - MySQL seem to insist on continuing
to do this in the name of wringing the best performance they can, despite
users begging them to fix this bug.

Anyway, your connection string should look something like:

$dbh = DBI->connect(
    "dbi:mysql:dbname=some_database;host=some_ip_address;port=3306",
    "some_username",
    "some_password",
    {
        PrintError => 0,
        RaiseError => 0,
        AutoCommit => 1
    }
) || die $DBI::errstr;

Note the 'port=3306' bit. 3306 is the default port. If you're running
multiple MySQL instances, you will have to edit your my.cnf server config
file and force subsequent instances to use a different port. Then you
change the port number in the connection string.

That should be it.

Dan

Reply via email to