Knowledgebase

Find frequently asked questions and setup guides by searching or by browsing the categories.

The Short Answer

Both are open-source relational database servers that store data in InnoDB tables and answer SQL over the same client protocol. An application that uses common SQL, such as most content management systems, works with either. The differences show up in administration: how accounts log in, which features exist, how replication is set up, and which commands you type. Neither is a drop-in replacement for the current version of the other.

Where MariaDB Came From

MariaDB began in 2009, when some of MySQL's original developers forked the code around the time MySQL changed owners. For several years MariaDB tracked MySQL closely, and a server could be swapped for the other without changes. Since then both projects have added features on their own, and the version numbers have separated: MySQL counts 8.x, 9.x, and up, MariaDB 10.x, 11.x, and up. A MariaDB 10 is not older than a MySQL 8; the numbers are not comparable. For background on the server itself, see what is MySQL.

Differences That Matter on a Server

TopicMySQLMariaDB
Password logincaching_sha2native password
Root on installSocket on UbuntuSocket
JSON columnBinary typeText with a check
GTIDsOwn formatOwn format
ClusteringGroup ReplicationGalera
Clientmysqlmariadb
Dump toolmysqldumpmariadb-dump
Server programmysqldmariadbd

Authentication

MySQL's default password method is caching_sha2_password. The older mysql_native_password is disabled by default in MySQL 8.4 and removed in 9.0. MariaDB still uses mysql_native_password for password accounts and creates root with the unix_socket plugin, so sudo mariadb logs in without a password. On Ubuntu, MySQL's root uses the similar auth_socket plugin. A client library that is old enough may support only one of these methods, which is a common reason a program connects to one server and not the other.

JSON, Replication, and Features

  • JSON: MySQL stores JSON in a binary format of its own. In MariaDB, JSON is another name for a long text column with a validity check. The JSON functions overlap but are not identical.
  • Replication: both have binary-log replication and GTIDs, but the GTID formats differ. Replicating between the two works only in limited cases; test it before you rely on it.
  • Own features: MariaDB has sequences, system-versioned tables, and the Aria engine. MySQL has the X Protocol on port 33060 and its document store.

Which One Each Distribution Ships

DistributionPackaged server
UbuntuBoth; MySQL is mysql-server
Debian 12, 13MariaDB only
AlmaLinux, RockyBoth, in AppStream

Ubuntu 24.04 ships MySQL 8.0 and Ubuntu 26.04 ships MySQL 8.4. The installation steps are in how to install MySQL on Ubuntu and how to install MariaDB. On Debian, default-mysql-server installs MariaDB, and the mysql command there is MariaDB's client.

How to Tell Which One You Have

sudo mysql -e "SELECT VERSION();"

A MariaDB server includes the word MariaDB in the version string. See how to check the MySQL version for the other methods.

Switching Between Them

  1. Dump every database with the tool of the current server, for example mysqldump --single-transaction app redirected to a file, and copy the dumps off the server.
  2. Install the other server on a new or test machine, not over the existing data directory. Neither server reliably reads the other's current data files.
  3. Recreate the accounts with CREATE USER and GRANT, because login plugins differ.
  4. Load the dumps and run the application's tests against the new server.
  5. Switch the application only after the tests pass.
Was this answer helpful?
Loading...