Skip to main content

MySQL

Pronunciation
my-ES-kyoo-EL
Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/mysql

In short

MySQL is a popular open-source relational database queried with SQL, long known as the database behind WordPress and the classic LAMP web stack.

What is MySQL?

MySQL was first released in 1995 by the Swedish company MySQL AB. Sun Microsystems bought it in 2008, and Oracle took it over when it acquired Sun in 2010. It is a relational database management system: data is organized in tables with rows and columns, and applications read and change it with SQL.

It became famous as the M in the LAMP stack, Linux, Apache, MySQL and PHP, which powered a large part of the early web. WordPress, Drupal and many other content management systems still use it by default, and almost every web host offers it. Its default storage engine, InnoDB, supports transactions, row-level locking and foreign keys.

MySQL is valued for being easy to install, fast for common read-heavy workloads and supported by every major language and cloud. It can replicate data from a primary server to read replicas, which is a common way to scale reads. Large sites run it at enormous scale with tools that shard data across many servers.

A common misconception is that MySQL and MariaDB are the same product. MariaDB is a fork started in 2009 by MySQL's original creator, and the two have drifted apart over the years, although they remain largely compatible. MySQL itself is available both under the GPL open-source license and under commercial licenses from Oracle.

Key takeaways

  • MySQL is an open-source relational database that uses SQL.
  • It is the M in the classic LAMP stack and the default for WordPress.
  • The InnoDB engine provides transactions, row locking and foreign keys.
  • Read replicas are a common way to scale MySQL.
  • MariaDB is a separate fork made by MySQL's original creator.

Example

Creating a table and reading from itsql
CREATE TABLE posts (
  id         INT AUTO_INCREMENT PRIMARY KEY,
  title      VARCHAR(200) NOT NULL,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP
) ENGINE = InnoDB;

INSERT INTO posts (title) VALUES ('Hello, world');

SELECT id, title FROM posts ORDER BY created_at DESC LIMIT 10;

Readers ask

Is MySQL free?

The MySQL Community Edition is free and open source under the GPL. Oracle also sells commercial editions with extra features and support.

What is the difference between MySQL and MariaDB?

MariaDB is a fork of MySQL created in 2009 by Michael Widenius, one of MySQL's founders. It started as a drop-in replacement, and while the two are still largely compatible, each now has features the other lacks.

Is MySQL a NoSQL database?

No. MySQL is a relational SQL database, although it can store and query JSON columns for more flexible data.

Often compared

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings