Contact

What is MySQL?

Definition

MySQL is a relational database management system first released in the mid-1990s by the Swedish company MySQL AB and now owned and developed by Oracle. The Community Edition is open source under GPLv2, while enterprise editions and OEM use are available under commercial licences. Its default storage engine, InnoDB, supports transactions, row-level locking and foreign keys, and MySQL is the standard database behind WordPress and much shared hosting.

Also known as: MySQL Server, MySQL Community Edition

Web app sending writes to a MySQL primary and read queries to a replica kept in sync through the binary log, with nightly dumps

History and licensing

MySQL was first released in 1995 by MySQL AB in Sweden. Sun Microsystems bought the company in 2008, and Oracle acquired Sun in 2010; Oracle has developed MySQL ever since. Licensing is dual. The server and client libraries are published under GPLv2 as open source, and Oracle sells a commercial licence to companies that want to embed and distribute MySQL inside proprietary software without taking on GPL obligations. Enterprise editions add tooling and support on top.

After the Oracle acquisition, some of MySQL's original developers started a fork called MariaDB in 2009. The two stayed broadly compatible for years, but features and version numbers have drifted apart, so check the specific features you rely on before treating one as a drop-in replacement for the other.

InnoDB and the clustered index

MySQL delegates physical storage to pluggable storage engines. Today the default, and in practice the only serious choice, is InnoDB, which provides transactions, row-level locking, crash recovery and foreign key enforcement. MyISAM, still found in older projects, has neither transactions nor foreign keys.

InnoDB's defining design choice is that table data lives inside a B-tree ordered by the primary key, known as a clustered index. Secondary indexes store the primary key value rather than a physical row address. Two practical consequences follow:

  • A wide primary key, such as a 36-character UUID stored as text, makes every index on the table bigger.
  • Randomly distributed keys land all over the tree, causing page splits and fragmentation, whereas increasing integers or time-ordered IDs append neatly at the end.

Behaviour that surprises people coming from elsewhere

  • Isolation level: InnoDB defaults to REPEATABLE READ, while PostgreSQL defaults to Read Committed, so identical application code can behave differently under concurrent load. See database transaction for what the levels mean.
  • Indexes on foreign keys: InnoDB automatically creates an index on the referencing columns of a foreign key if a suitable one does not exist. ON DELETE SET DEFAULT parses but is rejected by InnoDB.
  • utf8 versus utf8mb4: in MySQL, utf8 has historically been an alias for utf8mb3, which stores at most three bytes per character and cannot hold four-byte characters such as emoji. Full Unicode needs utf8mb4, the default since MySQL 8.0, but tables carried over from older installations are worth checking.
  • Lenient legacy modes: older setups with a non-strict sql_mode could silently truncate values that did not fit a column. Code that quietly relied on this tends to surface during upgrades.

Release model

Oracle runs two release tracks. LTS releases, such as 8.4, receive only necessary fixes and long support. Innovation releases bring new features, behaviour changes and removals, and are supported only until the next Innovation release. Production web applications usually stay on an LTS line; the upgrade paths between tracks are spelled out in the MySQL reference manual.

Where you will meet it

MySQL is the “M” in the LAMP stack (Linux, Apache, MySQL, PHP) and the default database for WordPress, many e-commerce platforms and most shared hosting plans. Scaling reads through replicas fed by the binary log is a common pattern. Choosing between MySQL and PostgreSQL usually comes down to team experience, the hosting environment and which databases the application itself supports, more than to any clear-cut technical superiority.

Related terms

← Back to the glossary