{
    "title": "MySQL and MariaDB",
    "seo_title": "MySQL and MariaDB: definition, differences and WordPress",
    "h1": "MySQL and MariaDB",
    "description": "MySQL and MariaDB: the database's role in WordPress, how the two differ, recommended versions and security best practices.",
    "lead": "MySQL and MariaDB are two relational database management systems, using the SQL language, where WordPress stores posts, pages, settings, accounts and orders. MariaDB started as a fork of MySQL led by original MySQL developers, and remains largely compatible with it for WordPress.",
    "language": "en",
    "locale": "en-US",
    "type": "definition",
    "url": "https://www.wp-masquerade.com/glossary/mysql-mariadb/",
    "canonical": "https://www.wp-masquerade.com/glossary/mysql-mariadb/",
    "markdown": "https://www.wp-masquerade.com/glossary/mysql-mariadb/index.md",
    "json": "https://www.wp-masquerade.com/glossary/mysql-mariadb/index.json",
    "published": "2026-10-28T08:00:00+00:00",
    "modified": "2026-10-28T22:58:02+00:00",
    "site": {
        "name": "WP Masquerade",
        "url": "https://www.wp-masquerade.com/"
    },
    "translations": [
        {
            "language": "en",
            "hreflang": "en-US",
            "title": "MySQL and MariaDB",
            "url": "https://www.wp-masquerade.com/glossary/mysql-mariadb/",
            "markdown": "https://www.wp-masquerade.com/glossary/mysql-mariadb/index.md",
            "json": "https://www.wp-masquerade.com/glossary/mysql-mariadb/index.json"
        },
        {
            "language": "fr",
            "hreflang": "fr-FR",
            "title": "MySQL et MariaDB",
            "url": "https://www.wp-masquerade.com/fr/definitions/mysql-mariadb/",
            "markdown": "https://www.wp-masquerade.com/fr/definitions/mysql-mariadb/index.md",
            "json": "https://www.wp-masquerade.com/fr/definitions/mysql-mariadb/index.json"
        },
        {
            "language": "es",
            "hreflang": "es-ES",
            "title": "MySQL y MariaDB",
            "url": "https://www.wp-masquerade.com/es/glosario/mysql-mariadb/",
            "markdown": "https://www.wp-masquerade.com/es/glosario/mysql-mariadb/index.md",
            "json": "https://www.wp-masquerade.com/es/glosario/mysql-mariadb/index.json"
        },
        {
            "language": "de",
            "hreflang": "de-DE",
            "title": "MySQL und MariaDB",
            "url": "https://www.wp-masquerade.com/de/glossar/mysql-mariadb/",
            "markdown": "https://www.wp-masquerade.com/de/glossar/mysql-mariadb/index.md",
            "json": "https://www.wp-masquerade.com/de/glossar/mysql-mariadb/index.json"
        },
        {
            "language": "it",
            "hreflang": "it-IT",
            "title": "MySQL e MariaDB",
            "url": "https://www.wp-masquerade.com/it/glossario/mysql-mariadb/",
            "markdown": "https://www.wp-masquerade.com/it/glossario/mysql-mariadb/index.md",
            "json": "https://www.wp-masquerade.com/it/glossario/mysql-mariadb/index.json"
        },
        {
            "language": "pt",
            "hreflang": "pt-BR",
            "title": "MySQL e MariaDB",
            "url": "https://www.wp-masquerade.com/pt/glossario/mysql-mariadb/",
            "markdown": "https://www.wp-masquerade.com/pt/glossario/mysql-mariadb/index.md",
            "json": "https://www.wp-masquerade.com/pt/glossario/mysql-mariadb/index.json"
        },
        {
            "language": "nl",
            "hreflang": "nl-NL",
            "title": "MySQL en MariaDB",
            "url": "https://www.wp-masquerade.com/nl/woordenlijst/mysql-mariadb/",
            "markdown": "https://www.wp-masquerade.com/nl/woordenlijst/mysql-mariadb/index.md",
            "json": "https://www.wp-masquerade.com/nl/woordenlijst/mysql-mariadb/index.json"
        }
    ],
    "headings": [
        {
            "level": 1,
            "text": "MySQL and MariaDB"
        },
        {
            "level": 2,
            "text": "MySQL and MariaDB: what's the difference?"
        },
        {
            "level": 2,
            "text": "How WordPress uses the database"
        },
        {
            "level": 2,
            "text": "Security"
        },
        {
            "level": 2,
            "text": "For WordPress"
        },
        {
            "level": 2,
            "text": "Common mistakes"
        }
    ],
    "body": "Everything in a WordPress site that isn't a file lives in the database: content, menus, plugin settings, user accounts, comments, WooCommerce orders. PHP queries it in SQL every time it generates a page. WordPress works with MySQL or MariaDB and currently recommends MySQL 8.0 or later, or MariaDB 10.11 or later.\n\n## MySQL and MariaDB: what's the difference?\n\nMySQL is the original system, now developed by Oracle. MariaDB was started by original MySQL developers; the MariaDB Foundation presents Michael “Monty” Widenius, former CTO of MySQL AB, as its spiritual father, and is committed to keeping MariaDB Server open source under the GPLv2 license.\n\n![Two-column comparison. MySQL: now developed by Oracle, InnoDB storage engine by default, version recommended by WordPress 8.0 or later. MariaDB: created by original MySQL developers led by Michael Widenius, committed to staying open source under the GPLv2 license, designed as a compatible replacement for MySQL with differences that grow with each version, version recommended by WordPress 10.11 or later.](https://www.wp-masquerade.com/media/2026/10/mysql-mariadb-en-1.webp)\n\n*Either one works for WordPress: what matters is a supported version.*\n\nMariaDB was designed as an enhanced, compatible replacement for MySQL. Its documentation acknowledges, however, that implementation differences grow with each release: JSON types, replication, functions and system variables diverge. For WordPress, which uses plain SQL, the two are equivalent; to migrate a server from one to the other, a full backup and a test run beforehand are still essential.\n\n## How WordPress uses the database\n\nTables carry a prefix, wp_ by default: wp_posts for content, wp_postmeta for its associated data, wp_options for settings, wp_users for accounts. The connection credentials are stored in wp-config.php:\n\n```\ndefine( 'DB_NAME', 'database_name' );\ndefine( 'DB_USER', 'username' );\ndefine( 'DB_PASSWORD', 'password' );\ndefine( 'DB_HOST', 'localhost' );\n```\n\nDB_HOST is most often localhost, but not always: some hosts put the database on another server, and a port or socket can be added after a colon. Tables use the InnoDB engine, MySQL's default, which brings transactions, row-level locking and crash recovery. The WordPress documentation advises converting old MyISAM tables to InnoDB.\n\n## Security\n\n- **One user per site**, with all privileges on its own database and none on the others. In a control panel like [cPanel](https://www.wp-masquerade.com/glossary/cpanel/), the database wizard offers this directly.\n- **No unnecessary remote access**: the database port (3306 by default) shouldn't be open to the internet.\n- **A strong, unique password**, protected in a wp-config.php file with restricted permissions; our article on [wp-config.php security settings](https://www.wp-masquerade.com/wp-config-security-settings/) covers the right choices.\n- **Plugin code**: queries built without $wpdb->prepare() open the door to [SQL injection](https://www.wp-masquerade.com/glossary/sql-injection/), one of the most serious vulnerabilities a site can have.\n\n## For WordPress\n\n- Back up the database separately from the files and test the restore: the database changes with every comment or order. The [3-2-1 backup strategy](https://www.wp-masquerade.com/wordpress-backups-3-2-1-strategy/) applies to it too.\n- With [WP-CLI](https://www.wp-masquerade.com/glossary/wp-cli/), `wp db export` produces an SQL copy in one command; never leave it in a public folder.\n- Keep an eye on the size of autoloaded options in wp_options: deleted plugins often leave data behind there that is read on every page.\n- On a busy site, a [persistent object cache](https://www.wp-masquerade.com/glossary/redis-memcached/) cuts the number of queries sent to the database.\n\n## Common mistakes\n\nUsing the database root account for WordPress, keeping a MySQL or MariaDB version that no longer receives patches, leaving the database out of backups, or exposing phpMyAdmin without protection, a favorite target of scanning bots.\n\n## Related terms\n\n- [SQL injection](https://www.wp-masquerade.com/glossary/sql-injection/)\n- [Redis and Memcached (object cache)](https://www.wp-masquerade.com/glossary/redis-memcached/)\n- [cPanel](https://www.wp-masquerade.com/glossary/cpanel/)\n- [WP-CLI](https://www.wp-masquerade.com/glossary/wp-cli/)\n- [3-2-1 backup rule](https://www.wp-masquerade.com/glossary/3-2-1-backup-rule/)\n\n\n## Sources\n\n- [WordPress.org : Requirements](https://wordpress.org/about/requirements/)\n- [MariaDB Foundation : About MariaDB Server](https://mariadb.org/about/)\n- [MariaDB Docs : MariaDB vs MySQL compatibility](https://mariadb.com/docs/release-notes/community-server/about/compatibility-and-differences/mariadb-vs-mysql-compatibility)\n- [MySQL 8.4 Reference Manual : Introduction to InnoDB](https://dev.mysql.com/doc/refman/8.4/en/innodb-introduction.html)",
    "definition": "MySQL and MariaDB are two relational database management systems, using the SQL language, where WordPress stores posts, pages, settings, accounts and orders. MariaDB started as a fork of MySQL led by original MySQL developers, and remains largely compatible with it for WordPress.",
    "group": "Web hosting",
    "aka": [
        "MySQL",
        "MariaDB",
        "database",
        "DBMS",
        "InnoDB"
    ],
    "related": [
        {
            "title": "SQL injection",
            "url": "https://www.wp-masquerade.com/glossary/sql-injection/",
            "markdown": "https://www.wp-masquerade.com/glossary/sql-injection/index.md"
        },
        {
            "title": "Redis and Memcached (object cache)",
            "url": "https://www.wp-masquerade.com/glossary/redis-memcached/",
            "markdown": "https://www.wp-masquerade.com/glossary/redis-memcached/index.md"
        },
        {
            "title": "cPanel",
            "url": "https://www.wp-masquerade.com/glossary/cpanel/",
            "markdown": "https://www.wp-masquerade.com/glossary/cpanel/index.md"
        },
        {
            "title": "WP-CLI",
            "url": "https://www.wp-masquerade.com/glossary/wp-cli/",
            "markdown": "https://www.wp-masquerade.com/glossary/wp-cli/index.md"
        },
        {
            "title": "3-2-1 backup rule",
            "url": "https://www.wp-masquerade.com/glossary/3-2-1-backup-rule/",
            "markdown": "https://www.wp-masquerade.com/glossary/3-2-1-backup-rule/index.md"
        }
    ],
    "sources": [
        {
            "title": "WordPress.org : Requirements",
            "url": "https://wordpress.org/about/requirements/"
        },
        {
            "title": "MariaDB Foundation : About MariaDB Server",
            "url": "https://mariadb.org/about/"
        },
        {
            "title": "MariaDB Docs : MariaDB vs MySQL compatibility",
            "url": "https://mariadb.com/docs/release-notes/community-server/about/compatibility-and-differences/mariadb-vs-mysql-compatibility"
        },
        {
            "title": "MySQL 8.4 Reference Manual : Introduction to InnoDB",
            "url": "https://dev.mysql.com/doc/refman/8.4/en/innodb-introduction.html"
        }
    ],
    "format": "application/json"
}