欢迎光临散文网 会员登陆 & 注册

【准备篇】1.1 MySQL及其历史背景介绍

2023-06-16 22:13 作者:数据库进阶  | 我要投稿

MySQL及其历史背景


目录

1. 什么是MySQL

2. MySQL的关键特性

Internals and Portability

Data Types

Statements and Functions

Security

Scalability and Limits

Connectivity

Localization

Clients and Tools

3. MySQL的历史发展

历史概况

版本线

4. References



1. 什么是MySQL

MySQL, the most popular Open Source SQL database management system, is developed, distributed, and supported by Oracle Corporation.

The MySQL website (http://www.mysql.com/) provides the latest information about MySQL software.

  • MySQL is a database management system.
  • A database is a structured collection of data. It may be anything from a simple shopping list to a picture gallery or the vast amounts of information in a corporate network. To add, access, and process data stored in a computer database, you need a database management system such as MySQL Server. Since computers are very good at handling large amounts of data, database management systems play a central role in computing, as standalone utilities, or as parts of other applications.
  • MySQL databases are relational.
  • A relational database stores data in separate tables rather than putting all the data in one big storeroom. The database structures are organized into physical files optimized for speed. The logical model, with objects such as databases, tables, views, rows, and columns, offers a flexible programming environment. You set up rules governing the relationships between different data fields, such as one-to-one, one-to-many, unique, required or optional, and “pointers” between different tables. The database enforces these rules, so that with a well-designed database, your application never sees inconsistent, duplicate, orphan, out-of-date, or missing data.
  • The SQL part of “MySQL” stands for “Structured Query Language”. SQL is the most common standardized language used to access databases. Depending on your programming environment, you might enter SQL directly (for example, to generate reports), embed SQL statements into code written in another language, or use a language-specific API that hides the SQL syntax.
  • SQL is defined by the ANSI/ISO SQL Standard. The SQL standard has been evolving since 1986 and several versions exist. In this manual, “SQL-92” refers to the standard released in 1992, “SQL:1999” refers to the standard released in 1999, and “SQL:2003” refers to the current version of the standard. We use the phrase “the SQL standard” to mean the current version of the SQL Standard at any time.
  • MySQL software is Open Source.
  • Open Source means that it is possible for anyone to use and modify the software. Anybody can download the MySQL software from the Internet and use it without paying anything. If you wish, you may study the source code and change it to suit your needs. The MySQL software uses the GPL (GNU General Public License), http://www.fsf.org/licenses/, to define what you may and may not do with the software in different situations. If you feel uncomfortable with the GPL or need to embed MySQL code into a commercial application, you can buy a commercially licensed version from us. See the MySQL Licensing Overview for more information (http://www.mysql.com/company/legal/licensing/).
  • The MySQL Database Server is very fast, reliable, scalable, and easy to use.
  • If that is what you are looking for, you should give it a try. MySQL Server can run comfortably on a desktop or laptop, alongside your other applications, web servers, and so on, requiring little or no attention. If you dedicate an entire machine to MySQL, you can adjust the settings to take advantage of all the memory, CPU power, and I/O capacity available. MySQL can also scale up to clusters of machines, networked together.
  • MySQL Server was originally developed to handle large databases much faster than existing solutions and has been successfully used in highly demanding production environments for several years. Although under constant development, MySQL Server today offers a rich and useful set of functions. Its connectivity, speed, and security make MySQL Server highly suited for accessing databases on the Internet.
  • MySQL Server works in client/server or embedded systems.
  • The MySQL Database Software is a client/server system that consists of a multithreaded SQL server that supports different back ends, several different client programs and libraries, administrative tools, and a wide range of application programming interfaces (APIs).
  • We also provide MySQL Server as an embedded multithreaded library that you can link into your application to get a smaller, faster, easier-to-manage standalone product.
  • A large amount of contributed MySQL software is available.
  • MySQL Server has a practical set of features developed in close cooperation with our users. It is very likely that your favorite application or language supports the MySQL Database Server.
Note: The official way to pronounce “MySQL” is “My Ess Que Ell” (not “my sequel”), but we do not mind if you pronounce it as “my sequel” or in some other localized way.

2. MySQL的关键特性

This section describes some of the important characteristics of the MySQL Database Software. In most respects, the roadmap applies to all versions of MySQL. For information about features as they are introduced into MySQL on a series-specific basis, see the “In a Nutshell” section of the appropriate Manual:

  • MySQL 8.0: What Is New in MySQL 8.0
  • MySQL 5.7: Section 1.3, “What Is New in MySQL 5.7”

Internals and Portability

  • Written in C and C++.
  • Tested with a broad range of different compilers.
  • Works on many different platforms. See https://www.mysql.com/support/supportedplatforms/database.html.
  • For portability, configured using CMake.
  • Tested with Purify (a commercial memory leakage detector) as well as with Valgrind, a GPL tool (http://developer.kde.org/~sewardj/).
  • Uses multi-layered server design with independent modules.
  • Designed to be fully multithreaded using kernel threads, to easily use multiple CPUs if they are available.
  • Provides transactional and nontransactional storage engines.
  • Uses very fast B+tree disk tables (InnoDB) with index compression.
  • Designed to make it relatively easy to add other storage engines. This is useful if you want to provide an SQL interface for an in-house database.
  • Uses a very fast thread-based memory allocation system.
  • Executes very fast joins using an optimized nested-loop join.
  • Implements in-memory hash tables, which are used as temporary tables.
  • Implements SQL functions using a highly optimized class library that should be as fast as possible. Usually there is no memory allocation at all after query initialization.
  • Provides the server as a separate program for use in a client/server networked environment.

Data Types

  • Many data types: signed/unsigned integers 1, 2, 3, 4, and 8 bytes long, FLOAT, DOUBLE, CHAR, VARCHAR, BINARY, VARBINARY, TEXT, BLOB, DATE, TIME, DATETIME, TIMESTAMP, YEAR, SET, ENUM, and OpenGIS spatial types. See Chapter 11, Data Types.
  • Fixed-length and variable-length string types.

Statements and Functions

  • Full operator and function support in the SELECT list and WHERE clause of queries. For example:
mysql> SELECT CONCAT(first_name, ' ', last_name)
  -> FROM citizen
  -> WHERE income/dependents > 10000 AND age > 30;
  • Full support for SQL GROUP BY and ORDER BY clauses. Support for group functions (COUNT(), AVG(), STD(), SUM(), MAX(), MIN(), and GROUP_CONCAT()).
  • Support for LEFT OUTER JOIN and RIGHT OUTER JOIN with both standard SQL and ODBC syntax.
  • Support for aliases on tables and columns as required by standard SQL.
  • Support for DELETE, INSERT, REPLACE, and UPDATE to return the number of rows that were changed (affected), or to return the number of rows matched instead by setting a flag when connecting to the server.
  • Support for MySQL-specific SHOW statements that retrieve information about databases, storage engines, tables, and indexes. Support for the INFORMATION_SCHEMA database, implemented according to standard SQL.
  • An EXPLAIN statement to show how the optimizer resolves a query.
  • Independence of function names from table or column names. For example, ABS is a valid column name. The only restriction is that for a function call, no spaces are permitted between the function name and the “(” that follows it. See Section 9.3, “Keywords and Reserved Words”.
  • You can refer to tables from different databases in the same statement.

Security

  • A privilege and password system that is very flexible and secure, and that enables host-based verification.
  • Password security by encryption of all password traffic when you connect to a server.

Scalability and Limits

  • Support for large databases. We use MySQL Server with databases that contain 50 million records. We also know of users who use MySQL Server with 200,000 tables and about 5,000,000,000 rows.
  • Support for up to 64 indexes per table. Each index may consist of 1 to 16 columns or parts of columns. The maximum index width for InnoDB tables is either 767 bytes or 3072 bytes. See Section 14.23, “InnoDB Limits”. The maximum index width for MyISAM tables is 1000 bytes. See Section 15.2, “The MyISAM Storage Engine”. An index may use a prefix of a column for CHAR, VARCHAR, BLOB, or TEXT column types.

Connectivity

  • Clients can connect to MySQL Server using several protocols:
  • Clients can connect using TCP/IP sockets on any platform.
  • On Windows systems, clients can connect using named pipes if the server is started with the named_pipe system variable enabled. Windows servers also support shared-memory connections if started with the shared_memory system variable enabled. Clients can connect through shared memory by using the --protocol=memory option.
  • On Unix systems, clients can connect using Unix domain socket files.
  • MySQL client programs can be written in many languages. A client library written in C is available for clients written in C or C++, or for any language that provides C bindings.
  • APIs for C, C++, Eiffel, Java, Perl, PHP, Python, Ruby, and Tcl are available, enabling MySQL clients to be written in many languages. See Chapter 27, Connectors and APIs.
  • The Connector/ODBC (MyODBC) interface provides MySQL support for client programs that use ODBC (Open Database Connectivity) connections. For example, you can use MS Access to connect to your MySQL server. Clients can be run on Windows or Unix. Connector/ODBC source is available. All ODBC 2.5 functions are supported, as are many others. See MySQL Connector/ODBC Developer Guide.
  • The Connector/J interface provides MySQL support for Java client programs that use JDBC connections. Clients can be run on Windows or Unix. Connector/J source is available. See MySQL Connector/J 8.0 Developer Guide.
  • MySQL Connector/NET enables developers to easily create .NET applications that require secure, high-performance data connectivity with MySQL. It implements the required ADO.NET interfaces and integrates into ADO.NET aware tools. Developers can build applications using their choice of .NET languages. MySQL Connector/NET is a fully managed ADO.NET driver written in 100% pure C#. See MySQL Connector/NET Developer Guide.

Localization

  • The server can provide error messages to clients in many languages. See Section 10.12, “Setting the Error Message Language”.
  • Full support for several different character sets, including latin1 (cp1252), german, big5, ujis, several Unicode character sets, and more. For example, the Scandinavian characters “å”, “ä” and “ö” are permitted in table and column names.
  • All data is saved in the chosen character set.
  • Sorting and comparisons are done according to the default character set and collation. It is possible to change this when the MySQL server is started (see Section 10.3.2, “Server Character Set and Collation”). To see an example of very advanced sorting, look at the Czech sorting code. MySQL Server supports many different character sets that can be specified at compile time and runtime.
  • The server time zone can be changed dynamically, and individual clients can specify their own time zone. See Section 5.1.13, “MySQL Server Time Zone Support”.

Clients and Tools

  • MySQL includes several client and utility programs. These include both command-line programs such as mysqldump and mysqladmin, and graphical programs such as MySQL Workbench.
  • MySQL Server has built-in support for SQL statements to check, optimize, and repair tables. These statements are available from the command line through the mysqlcheck client. MySQL also includes myisamchk, a very fast command-line utility for performing these operations on MyISAM tables. See Chapter 4, MySQL Programs.
  • MySQL programs can be invoked with the --help or -? option to obtain online assistance.

3. MySQL的历史发展

历史概况

MySQL的历史可以追溯到20世纪90年代初,下面是MySQL的主要里程碑和演变过程的详细介绍:

  1. 创建MySQL AB(1995年):MySQL最初由Michael Widenius、David Axmark和Allan Larsson于1995年创建,他们共同组建了MySQL AB公司,MySQL的名字也源自于Michael Widenius的女儿名字"My"和英语单词"SQL"(结构化查询语言)的缩写。MySQL AB的目标是开发一个轻量级的、易于使用的数据库管理系统。
  2. MySQL的早期版本(1995-1996年):最早的MySQL版本是基于瑞典公司TcX DataKonsult开发的mSQL数据库系统。MySQL AB的创始人对mSQL进行了改进和优化,发布了MySQL 1.0版,成为第一个商业化的MySQL版本。这个版本具备了关系型数据库的基本功能,并提供了简单的SQL查询语言支持。
  3. 开源发布(2000年):为了扩大MySQL的用户群和推广,MySQL AB在2000年将MySQL的核心代码开源,并使用了GNU通用公共许可证(GPL)作为开源许可证。这一举动加速了MySQL的发展,并吸引了全球开发者的关注。开源使得更多人可以参与MySQL的改进和扩展,并为MySQL的普及打下了坚实的基础。
  4. MySQL AB的发展(2000-2008年):MySQL AB公司在开源数据库市场上取得了成功,发布了一系列稳定和功能强大的MySQL版本。MySQL逐渐成为流行的数据库选择,尤其在Web应用开发中得到广泛应用。在这段时间里,MySQL不断改进其性能、可靠性和扩展性,并引入了更多的高级功能,如存储过程、触发器和视图等。
  5. Sun Microsystems的收购(2008年):2008年,Sun Microsystems(日本公司甲骨文公司的前身)收购了MySQL AB,将MySQL纳入其产品线,并继续支持和推动MySQL的发展。这个收购进一步增强了MySQL的实力和影响力,使其成为一款备受关注的数据库管理系统。
  6. Oracle的收购(2010年):随着Sun Microsystems被Oracle收购,MySQL也成为Oracle旗下的产品之一。这引发了一些关于MySQL的开源性质和未来发展的争议,但Oracle承诺继续支持MySQL的开源发展,并继续发布新版本。MySQL的开发团队和社区仍然积极参与开发和改进,确保MySQL的持续演进和创新。
  7. MySQL的演进和社区发展(2010年至今):自2010年以来,MySQL一直在持续演进和改进。MySQL 5.5、5.6、5.7和8.0版本相继发布,引入了许多新功能和性能优化。这些版本增强了MySQL的可靠性、可扩展性和安全性,并提供了更多的高级功能,如JSON支持和复制增强。此外,MySQL社区的贡献者和开发者积极参与,不断推动MySQL的发展。

版本线

以下是MySQL所有重要版本的发布时间的简要描述:

  1. MySQL 1.0:最早的商业化版本,发布于1995年。
  2. MySQL 3.23:引入了许多重要功能,如存储过程、触发器和视图。发布于2001年。
  3. MySQL 4.0:增加了更多的功能和性能优化,如子查询和InnoDB存储引擎。发布于2003年。
  4. MySQL 4.1:引入了更多的高级功能和改进,如表分区和行级复制。发布于2004年。
  5. MySQL 5.0:引入了一系列重要的功能,包括视图、存储过程、触发器、事件调度和InnoDB存储引擎的默认支持。发布于2005年。
  6. MySQL 5.1:增加了性能和可靠性方面的改进,并引入了复制增强功能。发布于2008年。
  7. MySQL 5.5:进一步提升了性能和可靠性,引入了半同步复制和InnoDB存储引擎的改进。发布于2010年。
  8. MySQL 5.6:引入了更多的性能和扩展性优化,包括多线程复制和全文索引改进。发布于2013年。
  9. MySQL 5.7:增加了JSON支持、在线DDL和更强大的查询优化功能。发布于2015年。
  10. MySQL 8.0:引入了许多重要的新特性和改进,包括事务性数据字典、窗口函数、公共表表达式、JSON扩展等。发布于2018年。

(不支持,表格省略)

这些版本的发布时间表明MySQL在过去几十年中持续发展,并不断推出新功能和改进,以满足不断增长的数据库需求。每个版本都为用户提供了更多的功能和性能优化,使MySQL成为一个强大且广泛使用的数据库管理系统。

4. References

1. [MySQL :: MySQL 5.7 Release Notes](https://dev.mysql.com/doc/relnotes/mysql/5.7/en/)

2. [MySQL :: MySQL 8.0 Release Notes](https://dev.mysql.com/doc/relnotes/mysql/8.0/en/)

3. [MySQL - Wikipedia](https://en.wikipedia.org/wiki/MySQL)

4. [MySQL :: MySQL 5.7 Reference Manual :: 1.2 Overview of the MySQL Database Management System](https://dev.mysql.com/doc/refman/5.7/en/what-is.html)


【准备篇】1.1 MySQL及其历史背景介绍的评论 (共 条)

分享到微博请遵守国家法律