DBD::mysql - MySQL X Protocol driver for the Perl5 Database Interface (DBI)
This module is Copyright (c) 2018 Daniël van Eeden
use DBI; my $dsn = "DBI:mysqlx:localhost/test" my $dbh = DBI->connect($dsn, "msandbox", "msandbox"); $dbh->do("DO 1"); $dbh->disconnect();
The part of the DSN after
DBI:mysqlx: is identical to what you would use in a X Protocol URI after the
@. The DSN above would translate to
This driver allows you to connect to a MySQL 5.7.12 or newer database over the MySQL X Protocol. On 5.7 you need to configure it to load the
mysqlx plugin. See https://dev.mysql.com/doc/refman/5.7/en/document-store-setting-up.html for details.
DBD::mysql uses libmysqlclient, supports a wide range of MySQL and MariaDB versions and is stable. It uses the Classic MySQL Protocol.
DBD::mysqlx uses libmysqlcppconn8, only supports MySQL 5.7 and 8.0 and is experimental. It uses the new MySQL X Protocol, which is protobuf based.
The DSN format is different.
Attributes on the dbh and sth are different, except for DBI standard attributes.
DBD::mysqlx only supports last_insert_id() on the $sth, not on the $dbh.