Loading AI tools
SQL database engine software From Wikipedia, the free encyclopedia
MySQL (/ˌmaɪˌɛsˌkjuːˈɛl/)[6] is an open-source relational database management system (RDBMS).[6][7] Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My,[1] and "SQL", the acronym for Structured Query Language. A relational database organizes data into one or more data tables in which data may be related to each other; these relations help structure the data. SQL is a language that programmers use to create, modify and extract data from the relational database, as well as control user access to the database. In addition to relational databases and SQL, an RDBMS like MySQL works with an operating system to implement a relational database in a computer's storage system, manages users, allows for network access and facilitates testing database integrity and creation of backups.
Original author(s) | MySQL AB |
---|---|
Developer(s) | Oracle Corporation |
Initial release | 23 May 1995 |
Stable release | |
Repository | |
Written in | C, C++[3] |
Operating system | Linux, Solaris, macOS, Windows, FreeBSD[4] |
Available in | English |
Type | RDBMS |
License | GPLv2 or proprietary[5] |
Website | www |
MySQL is free and open-source software under the terms of the GNU General Public License, and is also available under a variety of proprietary licenses. MySQL was owned and sponsored by the Swedish company MySQL AB, which was bought by Sun Microsystems (now Oracle Corporation).[8] In 2010, when Oracle acquired Sun, Widenius forked the open-source MySQL project to create MariaDB.[9]
MySQL has stand-alone clients that allow users to interact directly with a MySQL database using SQL, but more often, MySQL is used with other programs to implement applications that need relational database capability. MySQL is a component of the LAMP web application software stack (and others), which is an acronym for Linux, Apache, MySQL, Perl/PHP/Python. MySQL is used by many database-driven web applications, including Drupal, Joomla, phpBB, and WordPress.[10] MySQL is also used by many popular websites, including Facebook,[11][12] Flickr,[13] MediaWiki,[14] Twitter,[15] and YouTube.[16]
MySQL is written in C and C++. Its SQL parser is written in yacc, but it uses a home-brewed lexical analyzer.[17] MySQL works on many system platforms, including AIX, BSDi, FreeBSD, HP-UX, ArcaOS, eComStation, IBM i, IRIX, Linux, macOS, Microsoft Windows, NetBSD, Novell NetWare, OpenBSD, OpenSolaris, OS/2 Warp, QNX, Oracle Solaris, Symbian, SunOS, SCO OpenServer, SCO UnixWare, Sanos and Tru64. A port of MySQL to OpenVMS also exists.[18]
The MySQL server software itself and the client libraries use dual-licensing distribution. They are offered under GPL version 2, or a proprietary license.[19]
Support can be obtained from the official manual.[20] Free support additionally is available in different IRC channels and forums. Oracle offers paid support via its MySQL Enterprise products. They differ in the scope of services and in price. Additionally, a number of third party organisations exist to provide support and services.
MySQL has received positive reviews, and reviewers noticed it "performs extremely well in the average case" and that the "developer interfaces are there, and the documentation (not to mention feedback in the real world via Web sites and the like) is very, very good".[21] It has also been tested to be a "fast, stable and true multi-user, multi-threaded SQL database server".[22]
MySQL was created by a Swedish company, MySQL AB, founded by Swedes David Axmark and Allan Larsson, along with Finnish Michael "Monty" Widenius. Original development of MySQL by Widenius and Axmark began in 1994.[23] The first version of MySQL appeared on 23 May 1995. It was initially created for personal usage from mSQL based on the low-level language ISAM, which the creators considered too slow and inflexible. They created a new SQL interface, while keeping the same API as mSQL. By keeping the API consistent with the mSQL system, many developers were able to use MySQL instead of the (proprietarily licensed) mSQL antecedent.[24]
Additional milestones in MySQL development included:
Release | General availability | Latest minor version | Latest release | End of support[46][47] |
---|---|---|---|---|
5.1 LTS | 14 November 2008[48] | 5.1.73[49] | 2013-12-03 | Dec 2013 |
5.5 LTS | 3 December 2010[50] | 5.5.62[51] | 2018-10-22 | Dec 2018 |
5.6 LTS | 5 February 2013[52] | 5.6.51[53] | 2021-01-20 | Feb 2021 |
5.7 LTS | 21 October 2015 [54] | 5.7.44[55] | 2023-10-25 | Oct 2023 |
8.0 LTS | 19 April 2018 [56] | 8.0.40[57] | 2024-10-15 | Apr 2026 |
8.1 IR | 18 July 2023[58] | 8.1.0[59] | 2023-07-18 | Oct 2023 |
8.2 IR | 25 October 2023[60] | 8.2.0[61] | 2023-10-25 | Jan 2024 |
8.3 IR | 16 January 2024[62] | 8.3.0[63] | 2024-01-16 | Apr 2024 |
8.4 LTS | 30 April 2024 [64] | 8.4.3[65] | 2024-10-15 | Apr 2032 |
9.0 IR | 1 July 2024 [66] | 9.0.1[67] | 2024-07-23 | Oct 2024 |
9.1 IR | 15 October 2024 [68] | 9.1.0[69] | 2024-10-15 | Jan 2025 |
Legend: Unsupported version Old version, still maintained Latest version Latest preview version |
Work on version 6 stopped after the Sun Microsystems acquisition. The MySQL Cluster product uses version 7. The decision was made to jump to version 8 as the next major version number.[70]
On 15 June 2001, NuSphere sued MySQL AB, TcX DataKonsult AB and its original authors Michael ("Monty") Widenius and David Axmark in U.S. District Court in Boston for "breach of contract, tortious interference with third party contracts and relationships and unfair competition".[71][72]
In 2002, MySQL AB sued Progress NuSphere for copyright and trademark infringement in United States district court. NuSphere had allegedly violated MySQL AB's copyright by linking MySQL's GPL'ed code with NuSphere Gemini table without being in compliance with the license.[73] After a preliminary hearing before Judge Patti Saris on 27 February 2002, the parties entered settlement talks and eventually settled.[74] After the hearing, FSF commented that "Judge Saris made clear that she sees the GNU GPL to be an enforceable and binding license."[75]
In October 2005, Oracle Corporation acquired Innobase OY, the Finnish company that developed the third-party InnoDB storage engine that allows MySQL to provide such functionality as transactions and foreign keys. After the acquisition, an Oracle press release mentioned that the contracts that make the company's software available to MySQL AB would be due for renewal (and presumably renegotiation) some time in 2006.[76] During the MySQL Users Conference in April 2006, MySQL AB issued a press release that confirmed that MySQL AB and Innobase OY agreed to a "multi-year" extension of their licensing agreement.[77]
In February 2006, Oracle Corporation acquired Sleepycat Software,[78] makers of the Berkeley DB, a database engine providing the basis for another MySQL storage engine. This had little effect, as Berkeley DB was not widely used, and was dropped (due to lack of use) in MySQL 5.1.12, a pre-GA release of MySQL 5.1 released in October 2006.[79]
In January 2008, Sun Microsystems bought MySQL AB for $1 billion.[80]
In April 2009, Oracle Corporation entered into an agreement to purchase Sun Microsystems,[81] then owners of MySQL copyright and trademark. Sun's board of directors unanimously approved the deal. It was also approved by Sun's shareholders, and by the U.S. government on 20 August 2009.[82] On 14 December 2009, Oracle pledged to continue to enhance MySQL[83] as it had done for the previous four years.
A movement against Oracle's acquisition of MySQL AB, to "Save MySQL"[84] from Oracle was started by one of the MySQL AB founders, Monty Widenius. The petition of 50,000+ developers and users called upon the European Commission to block approval of the acquisition. At the same time, some Free Software opinion leaders (including Pamela Jones of Groklaw, Jan Wildeboer and Carlo Piana, who also acted as co-counsel in the merger regulation procedure) advocated for the unconditional approval of the merger.[85][86][87] As part of the negotiations with the European Commission, Oracle committed that MySQL server will continue until at least 2015 to use the dual-licensing strategy long used by MySQL AB, with proprietary and GPL versions available. The antitrust of the EU had been "pressuring it to divest MySQL as a condition for approval of the merger". But the US Department of Justice, at the request of Oracle, pressured the EU to approve the merger unconditionally.[88] The European Commission eventually unconditionally approved Oracle's acquisition of MySQL AB on 21 January 2010.[89]
In January 2010, before Oracle's acquisition of MySQL AB, Monty Widenius started a GPL-only fork, MariaDB. MariaDB is based on the same code base as MySQL server 5.5 and aims to maintain compatibility with Oracle-provided versions.[90]
MySQL is offered under two different editions: the open source MySQL Community Server[91] and the proprietary Enterprise Server.[92] MySQL Enterprise Server is differentiated by a series of proprietary extensions which install as server plugins, but otherwise shares the version numbering system and is built from the same code base.
Major features as available in MySQL 5.6:
The developers release minor updates of the MySQL Server approximately every two months. The sources can be obtained from MySQL's website or from MySQL's GitHub repository, both under the GPL license.
When using some storage engines other than the default of InnoDB, MySQL does not comply with the full SQL standard for some of the implemented functionality, including foreign key references.[104] Check constraints are parsed but ignored by all storage engines before MySQL version 8.0.15.[105][106]
Up until MySQL 5.7, triggers are limited to one per action / timing, meaning that at most one trigger can be defined to be executed after an INSERT operation, and one before INSERT on the same table.[107] No triggers can be defined on views.[107]
Before MySQL 8.0.28, inbuilt functions like UNIX_TIMESTAMP() would return 0 after 03:14:07 UTC on 19 January 2038.[108] In 2017, an attempt to solve the problem was submitted, but was not used for the final solution that was shipped in 2022.[109][110][111]
MySQL can be built and installed manually from source code, but it is more commonly installed from a binary package unless special customizations are required. On most Linux distributions, the package management system can download and install MySQL with minimal effort, though further configuration is often required to adjust security and optimization settings.
Though MySQL began as a low-end alternative to more powerful proprietary databases, it has gradually evolved to support higher-scale needs as well. It is still most commonly used in small to medium scale single-server deployments, either as a component in a LAMP-based web application or as a standalone database server. Much of MySQL's appeal originates in its relative simplicity and ease of use, which is enabled by an ecosystem of open source tools such as phpMyAdmin. In the medium range, MySQL can be scaled by deploying it on more powerful hardware, such as a multi-processor server with gigabytes of memory.
There are, however, limits to how far performance can scale on a single server ('scaling up'), so on larger scales, multi-server MySQL ('scaling out') deployments are required to provide improved performance and reliability. A typical high-end configuration can include a powerful master database which handles data write operations and is replicated to multiple slaves that handle all read operations.[112] The master server continually pushes binlog events to connected slaves so in the event of failure a slave can be promoted to become the new master, minimizing downtime. Further improvements in performance can be achieved by caching the results from database queries in memory using memcached, or breaking down a database into smaller chunks called shards which can be spread across a number of distributed server clusters.[113]
Oracle MySQL offers a high availability solution with a mix of tools including the MySQL router and the MySQL shell. They are based on Group Replication, open source tools.[114]
MariaDB offers a similar offer in terms of products.[115]
MySQL can also be run on cloud computing platforms such as Microsoft Azure, Amazon Elastic Compute Cloud, and Oracle Cloud Infrastructure.[116] Some common deployment models for MySQL on the cloud are:
A graphical user interface (GUI) is a type of interface that allows users to interact with electronic devices or programs through graphical icons and visual indicators such as secondary notation, as opposed to text-based interfaces, typed command labels or text navigation.
Third-party proprietary and free graphical administration applications (or "front ends") are available that integrate with MySQL and enable users to work with database structure and data visually.
MySQL Workbench is the integrated environment for MySQL. It was developed by MySQL AB, and enables users to graphically administer MySQL databases and visually design database structures.
MySQL Workbench is available in three editions, the regular free and open source Community Edition which may be downloaded from the MySQL website, and the proprietary Standard Edition which extends and improves the feature set of the Community Edition, and the MySQL Cluster CGE.[121][122]
A command-line interface is a means of interacting with a computer program where the user issues commands to the program by typing in successive lines of text (command lines). MySQL ships with many command line tools, from which the main interface is the mysql client.[123][124]
MySQL Utilities is a set of utilities designed to perform common maintenance and administrative tasks. Originally included as part of the MySQL Workbench, the utilities are a stand-alone download available from Oracle.
Percona Toolkit is a cross-platform toolkit for MySQL, developed in Perl.[125] Percona Toolkit can be used to prove replication is working correctly, fix corrupted data, automate repetitive tasks, and speed up servers. Percona Toolkit is included with several Linux distributions such as CentOS and Debian, and packages are available for Fedora and Ubuntu as well. Percona Toolkit was originally developed as Maatkit, but as of late 2011, Maatkit is no longer developed.
MySQL shell is a tool for interactive use and administration of the MySQL database. It supports JavaScript, Python or SQL modes and it can be used for administration and access purposes.[126]
Many programming languages with language-specific APIs include libraries for accessing MySQL databases. These include MySQL Connector/Net for .NET/CLI Languages,[127] and the JDBC driver for Java.[128]
In addition, an ODBC interface called MySQL Connector/ODBC allows additional programming languages that support the ODBC interface to communicate with a MySQL database, such as ASP or ColdFusion. The HTSQL – URL-based query method also ships with a MySQL adapter, allowing direct interaction between a MySQL database and any web client via structured URLs. Other drivers exists for languages like Python[129] or Node.js.[130]
A variety of MySQL forks exist, including the following.
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.