What Is MySQL?
How MySQL Works as a Database Server
What is MySQL? MySQL is an open-source relational database management system that stores data in tables and answers queries written in SQL.
MySQL runs as a server process. Applications, such as a website's PHP code, connect to it over a network or a local socket, send SQL statements and receive results. Because the server handles storage, concurrent access and permissions, many applications can share one database safely.
Data is organized into databases, which contain tables of rows and columns. A typical website might have one database with tables for users, posts and comments. For a comparison with another popular option, see MySQL vs PostgreSQL.
History and Licensing of MySQL
MySQL was originally developed in the 1990s by the Swedish company MySQL AB. It was later acquired by Sun Microsystems, and when Oracle Corporation acquired Sun, MySQL came under Oracle's ownership.
The MySQL Community Edition is released under the GNU General Public License (GPL), so it can be downloaded and used without license fees. Oracle also sells commercial editions with added support and features, and a commercial license for companies that want to embed MySQL in proprietary software.
Why MySQL Became the Default for Websites
MySQL became popular as part of the LAMP stack, a combination of Linux, the Apache web server, MySQL and PHP. Its ease of installation and wide support made it a natural fit for dynamic websites, and many hosting plans include MySQL or MariaDB by default for that reason.
Content management systems such as WordPress store posts, pages, users and settings in MySQL or MariaDB. Tools such as phpMyAdmin, a web interface for managing databases, are also widely available on shared hosting. The result is a large community, plenty of documentation and many experienced administrators, which helps when a site grows.
Frequently asked questions
Does MySQL support transactions?
Yes, when tables use the InnoDB storage engine, which is the default in current versions. InnoDB supports ACID transactions with commits and rollbacks. Older engines such as MyISAM do not, so the storage engine matters. Read more about ACID transactions and InnoDB and MyISAM.
Is MySQL free to use?
The MySQL Community Edition is free to download and use under the GPL. Costs can arise from commercial editions, paid support, or a commercial license needed to distribute MySQL inside closed-source software. Managed database services also charge for their hosting, which is separate from the software license.