Mysql 简明教程
MySQL - Versions
版本被引入到任何产品中,通过添加额外的功能和删除不必要的功能、修复错误等来进行升级。版本化的过程实际上对于使产品随着技术的发展而变得更有效率非常重要。
Versions are introduced in any product to upgrade by adding extra features and removing unnecessary ones, fixing the bugs etc. The process of versioning is actually important to make the product more efficient with growing technology.
每当安装 MySQL 时,我们必须选择与发行格式一起安装的版本。MySQL 最新版本是 8.0 ,其次要版本是 8.0.34 。要安装 MySQL 服务器,有两种方法:开发版本和通用可用版本。
Whenever MySQL is installed, we must choose the version to install along with its distribution format. The latest version of MySQL is 8.0 with its minor version being 8.0.34. To install the MySQL server, there are two methods: Development release and General Availability.
开发版本包含所有最新功能,但建议不要在生产中使用。通用可用版本更像是可以在生产中稳定使用的生产版本。
The Development Release contains all the latest features but it is not recommended to be used in production. The General Availability Release is more of a production release which can be stably used in production.
MySQL Versions
MySQL 是一个快速、易于使用的 RDBMS,被许多小企业和大企业使用。它由瑞典公司 MySQL AB 开发、销售和支持。MySQL 最初于 1995 年 5 月 23 日内部发布,直到 Oracle 收购 Sun Microsystems,从 3.19 版到 5.1 版均已发布。
MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses. It is developed, marketed and supported by MySQL AB, which is a Swedish company. MySQL was first internally released on 23rd May, 1995, and until Oracle acquired Sun Microsystems, version 3.19 to version 5.1 were released.
Version 5.1
MySQL 的 5.1 版于 2008 年 11 月 27 日通过添加事件调度程序、分区、插件 API、基于行的复制、服务器日志表等额外功能发布。
The version 5.1 of MySQL had its production release on 27th November, 2008 by adding extra features like event scheduler, partitioning, plugin API, row-based replication, server log tables.
但是,5.1 版本包含 20 个已知错误,这些错误会产生错误的结果,还有 5.0 版本中的 35 个错误。不过,在 5.1.51 版本中几乎所有错误都得到了修复。此外,MySQL 5.1 和 6.0(处于 alpha 测试阶段)在数据仓库中表现出较差的性能,部分原因可能是它无法利用多个 CPU 内核来处理单个查询。
But, version 5.1 contained 20 known bugs that gave out wrong results, along with the 35 bugs from version 5.0. However, almost all of them are fixed as of release 5.1.51. Also, MySQL 5.1 and 6.0 (in alpha test phase) showed poor performance in data warehousing, which could partially be due to its inability to utilize multiple CPU cores for processing a single query.
Version 5.5
MySQL Server 5.5 于 2010 年 12 月成为通用可用版本。此版本中改进的功能包括−
MySQL Server 5.5 was a General Availability Release as of December 2010. The improved features in this version include −
-
The default storage engine is InnoDB with improved I/O subsystem, which supports transactions and referential integrity constraints.
-
Improved SMP support
-
Semi-synchronous replication.
-
SIGNAL and RESIGNAL statement was added in compliance with the SQL standard.
-
Support for supplementary Unicode character sets utf16, utf32, and utf8mb4.
-
New options for user-defined partitioning.
Version 5.6
MySQL 5.6 的通用可用版本于 2013 年 2 月发布。此版本的新功能包括:
The General Availability of MySQL 5.6 was released in February 2013. New features of this version included:
-
Query optimizer has more efficient performance.
-
Higher transactional throughput in InnoDB.
-
New NoSQL-style memcached APIs.
-
Improvements to partitioning for querying large tables.
-
Better management of very large tables.
-
TIMESTAMP column type that correctly stores milliseconds.
-
Improvements to replication.
-
Better performance monitoring by expanding the data available through the PERFORMANCE_SCHEMA.
-
The InnoDB storage engine also provides support for full-text search and improved group commit performance.
Version 5.7
MySQL 5.7 于 2015 年 10 月成为通用可用版本。在 MySQL 5.7 的次要版本,即 MySQL 5.7.8 及更高版本中,支持 2015 年 8 月由 RFC 7159 定义的本地 JSON 数据类型。
MySQL 5.7 was made generally available in October 2015. For the minor versions of MySQL 5.7, MySQL 5.7.8 and later, a support for a native JSON data type defined by RFC 7159 by August 2015.
Version 8.0
MySQL Server 8.0 于 2018 年 4 月发布,并具有新的改进功能。目前,MySQL 8.0 中的次要版本从 8.0.0 至 8.0.34。早前的 MySQL Server 8.0.0-dmr(作为开发里程碑版本)于 2016 年 9 月 12 日发布。
MySQL Server 8.0 was announced in April 2018, with new improved features. Currently, the minor versions in MySQL 8.0 start from 8.0.0 to 8.0.34. Previous MySQL Server 8.0.0-dmr (as a Development Milestone Release) was announced on 12th September, 2016.
Features Added in MySQL 8.0
MySQL 的最新版本是 8.0。其中一些新增加的功能包括:
The latest version of MySQL is 8.0. The following features are some of the newly added features to it:
-
Data dictionary − In previous MySQL releases, dictionary data was stored in metadata files and non-transactional tables. MySQL now incorporates a transactional data dictionary that stores information about database objects.
-
Atomic Data Definition Language(Atomic DDL) statements − An Atomic DDL statement combines the data dictionary updates, storage engine operations, and binary log writes associated with a DDL operation into a single, atomic transaction.
-
Upgrade procedure − Previously, after installation of a new version of MySQL, the MySQL server automatically upgrades the data dictionary tables at the next startup, after which the DBA is expected to invoke mysql_upgrade manually to upgrade the system tables in the mysql schema, as well as objects in other schemas such as the 'sys' schema and user schemas. As of MySQL 8.0.16, the server also performs the tasks previously handled by mysql_upgrade. In addition, the server updates the contents of the help tables as well. A new --upgrade server option provides control over how the server performs automatic data dictionary and server upgrade operations.
-
Session Reuse − MySQL Server now supports SSL session reuse by default with a timeout setting to control how long the server maintains a session cache that establishes the period during which a client is permitted to request session reuse for new connections. All MySQL client programs support session reuse. In addition, C applications now can use the C API capabilities to enable session reuse for encrypted connections.
-
Security and account management − The security is improved greatly and greater DBA flexibility in account management is also enabled.
-
Resource management − MySQL now supports creation and management of resource groups, and permits assigning threads running within the server to particular groups so that threads execute according to the resources available to the group.
-
Table encryption management − Table encryption can now be managed globally by defining and enforcing encryption defaults.
-
InnoDB enhancements − Several InnoDB enhancements were added, like, auto-increment counter value, index tree corruption, mem-cached plug-in, InnoDB_deadlock_detect, tablespace encryption feature, storage engine, InnoDB_dedicated_server, creating temporary tables in temporary tablespace, zlib library etc.
-
Character set support − The default character set has changed from latin1 to utf8mb4. The utf8mb4 character set has several new collations, including utf8mb4_ja_0900_as_cs, the first Japanese language-specific collation available for Unicode in MySQL.
-
JSON enhancements − Several enhancements and additions were made to MySQL’s JSON functionality.
-
Data type support − MySQL now supports use of expressions as default values in data type specifications. This includes the use of expressions as default values for the BLOB, TEXT, GEOMETRY, and JSON data types, which previously could not be assigned default values at all.
-
Optimizer − Optimizer is enhanced in various ways as well.
-
Improved hash join performance − MySQL 8.0.23 reimplements the hash table used for hash joins, resulting in several improvements in hash join performance.
-
Common table expressions − MySQL now supports common table expressions, both non-recursive and recursive.
-
Window functions − MySQL now supports window functions that, for each row from a query, perform a calculation using rows related to that row.
-
Lateral derived tables − A derived table now may be preceded by the LATERAL keyword to specify that it is permitted to refer to (depend on) columns of preceding tables in the same FROM clause.
-
Aliases in single-table DELETE statements − In MySQL 8.0.16 and later, single-table DELETE statements support the use of table aliases.
-
Regular expression support − Previously, MySQL used the Henry Spencer regular expression library to support regular expression operators.
-
Internal temporary tables − The TempTable storage engine replaces the MEMORY storage engine as the default engine for in-memory internal temporary tables.
-
Logging − Logging process is also improved in the newer versions.
除了所有这些之外,MySQL 的新版本中还添加了许多其他功能。
In addition to all these, there are many other features added to the new versions of MySQL as well.
Features Deprecated in MySQL 8.0
以下是 MySQL 8.0 中已弃用的众多功能中的一些,未来可能删除这些功能。应用程序可以使用提到的多个备选方案。
The following are some of the many features that are deprecated in MySQL 8.0 and may be removed in the future series. Several alternatives mentioned can be used by applications.
-
The utf8mb3 character set is deprecated. Please use utf8mb4 instead.
-
ucs2, macroman and macce, dec, hp8 are also deprecated. You should use utf8mb4 instead.
-
User-defined collations are deprecated.
-
sha256_password is deprecated.
-
The plugin form of validate_password is still available, but deprecated.
-
The ENGINE clause for the ALTER TABLESPACE and DROP TABLESPACE statements is deprecated.
-
The PAD_CHAR_TO_FULL_LENGTH SQL mode is deprecated.
-
AUTO_INCREMENT support is deprecated for columns of type FLOAT and DOUBLE (and any synonyms).
-
The UNSIGNED attribute is deprecated for columns of type FLOAT, DOUBLE, and DECIMAL (and any synonyms)
-
FLOAT(M,D) and DOUBLE(M,D) syntax is deprecated.
-
The ZEROFILL attribute for numeric data types and the display width attribute for integer data types are deprecated.
-
The BINARY attribute is deprecated. However, the use of BINARY to specify a data type or character set remains unchanged.
-
ASCII and UNICODE are deprecated (MySQL 8.0.28 and later). Use CHARACTER SET instead, in both cases.