Skip to main content

MySQL driver

  • Connection driver: mysql
  • Minimum server version: MySQL 8.4

The mysql driver is what a MySQL connection resolves to. It supplies the engine's own rules, the readers that answer questions about the live catalog, and the canonicalization that turns whatever the query builder emitted into one comparable form.

MariaDB is not covered by it

A MariaDB server answering on a connection configured as mysql is refused rather than checked, and the run reports mariadb_behind_mysql_driver. Laravel addresses both through the same driver name, but they are different engines: MySQL's online-DDL behavior — which algorithm a schema change runs under, whether it rebuilds the table, whether other sessions can keep writing — is not MariaDB's. Applying these rules there would produce confident, wrong advice, which is worse than no advice at all.

This is a declared non-goal, not an unfinished feature. The supported baseline is PostgreSQL and MySQL, and it is not going to grow a third engine — so there is nothing here to wait for. Laravel's mariadb driver key is a reserved name that can never be registered, and tests hold the refusal in place so that the promise and the behavior cannot drift apart.

The online-DDL facts are data, not folklore

What MySQL does with a given schema change is answered from a bundled matrix of the engine's own documented behavior, keyed by operation, and every entry cites the versioned manual page it was read from. That is why the driver can name a downtime class for a statement rather than guessing at one — and why a statement it cannot key is reported as undetermined with a reason instead of being assigned the most likely answer.

See the online-DDL matrix for the shape of that data and how to override it.

What the driver never does

It opens no transaction of its own, takes no lock, and writes nothing. Every rule reads a subject the capture layer already produced, and the catalog readers use catalog and statistics views only.