This section describes some of the important characteristics of the MySQL Database Software. 本节介绍MySQL数据库软件的一些重要特性。In most respects, the roadmap applies to all versions of MySQL. 在大多数方面,这个路线图适用于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的功能的信息,请参阅相应手册的“简而言之”部分:
MySQL 8.0: Section 1.3, “What Is New in MySQL 8.0”第1.3节,“MySQL 8.0的新增功能”
MySQL 5.7: What Is New in MySQL 5.7MySQL5.7的新增功能
MySQL 5.6: What Is New in MySQL 5.6MySQL5.6的新增功能
Written in C and C++.用C和C++编写。
Tested with a broad range of different compilers.经过广泛的不同编译器测试。
Works on many different platforms. 在许多不同的平台上工作。See https://www.mysql.com/support/supportedplatforms/database.html.请参阅https://www.mysql.com/support/supportedplatforms/database.html。
For portability, configured using CMake.为了便于移植,使用CMake进行配置。
Tested with Purify (a commercial memory leakage detector) as well as with Valgrind, a GPL tool (http://developer.kde.org/~sewardj/).用Purify(一种商用内存泄漏检测器)以及GPL工具Valgrind进行测试(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.设计成使用内核线程的完全多线程的,如果有多个CPU可用的话,可以很容易地使用它们。
Provides transactional and nontransactional storage engines.提供事务性和非事务性存储引擎。
Uses very fast B-tree disk tables (使用非常快速的B树磁盘表(MyISAM
) with index compression.MyISAM
)和索引压缩。
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.如果您想为内部数据库提供SQL接口,这将非常有用。
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. 使用高度优化的类库实现SQL函数,该类库应尽可能快。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, and as a library that can be embedded (linked) into standalone applications. 将服务器作为单独的程序提供,以便在客户机/服务器网络环境中使用,并作为可以嵌入(链接)到独立应用程序中的库提供。Such applications can be used in isolation or in environments where no network is available.此类应用程序可以在隔离环境中使用,也可以在没有网络可用的环境中使用。
Many data types: signed/unsigned integers 1, 2, 3, 4, and 8 bytes long, 许多数据类型:有符号/无符号整数1、2、3、4和8字节长、FLOAT
, DOUBLE
, CHAR
, VARCHAR
, BINARY
, VARBINARY
, TEXT
, BLOB
, DATE
, TIME
, DATETIME
, TIMESTAMP
, YEAR
, SET
, ENUM
, and OpenGIS spatial types. FLOAT
、DOUBLE
、CHAR
、VARCHAR
、BINARY
、VARBINARY
、TEXT
、BLOB
、DATE
、TIME
、DATETIME
、TIMESTAMP
、YEAR
、SET
、ENUM
和OpenGIS
空间类型。See Chapter 11, Data Types.见第11章,数据类型。
Fixed-length and variable-length string types.固定长度和可变长度字符串类型。
Full operator and function support in the 在查询的SELECT
list and WHERE
clause of queries. SELECT
列表和WHERE
子句中提供完整的运算符和函数支持。For example:例如:
mysql>SELECT CONCAT(first_name, ' ', last_name)
->FROM citizen
->WHERE income/dependents > 10000 AND age > 30;
Full support for SQL 完全支持SQL GROUP BY
and ORDER BY
clauses. GROUP BY
和ORDER BY
子句。Support for group functions (支持分组函数(COUNT()
, AVG()
, STD()
, SUM()
, MAX()
, MIN()
, and GROUP_CONCAT()
).COUNT()
、AVG()
、STD()
、SUM()
、MAX()
、MIN()
和group_CONCAT()
)。
Support for 支持标准SQL和ODBC语法的LEFT OUTER JOIN
and RIGHT OUTER JOIN
with both standard SQL and ODBC syntax.LEFT OUTER JOIN
和RIGHT OUTER JOIN
。
Support for aliases on tables and columns as required by standard SQL.支持标准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.DELETE
、INSERT
、REPLACE
和UPDATE
以返回更改(受影响)的行数,或者在连接到服务器时通过设置标志返回匹配的行数。
Support for MySQL-specific 支持特定于MySQL的SHOW
statements that retrieve information about databases, storage engines, tables, and indexes. SHOW
语句,这些语句检索有关数据库、存储引擎、表和索引的信息。Support for the 支持INFORMATION_SCHEMA
database, implemented according to standard SQL.INFORMATION_SCHEMA
数据库,根据标准SQL实现。
An EXPLAIN
statement to show how the optimizer resolves a query.EXPLAIN
语句,显示优化器如何解析查询。
Independence of function names from table or column names. 函数名与表名或列名的独立性。For example, 例如,ABS
is a valid column name. ABS
是一个有效的列名。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”.请参阅第9.3节,“关键字和保留字”。
You can refer to tables from different databases in the same statement.可以在同一语句中引用不同数据库中的表。
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.通过对连接到服务器时的所有密码通信进行加密实现密码安全。
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.我们使用MySQL服务器和包含5000万条记录的数据库。我们还知道一些用户使用MySQL服务器,拥有200,000个表和5,000,000,000行。
Support for up to 64 indexes per table. 每个表最多支持64个索引。Each index may consist of 1 to 16 columns or parts of columns. 每个索引可以由1到16列或部分列组成。The maximum index width for InnoDB
tables is either 767 bytes or 3072 bytes. InnoDB
表的最大索引宽度为767字节或3072字节。See Section 15.22, “InnoDB Limits”. 见第15.22节,“InnoDB限制”。The maximum index width for MyISAM
tables is 1000 bytes. MyISAM
表的最大索引宽度是1000字节。See Section 16.2, “The MyISAM Storage Engine”. 请参阅第16.2节,“MyISAM存储引擎”。An index may use a prefix of a column for 索引可以使用CHAR
, VARCHAR
, BLOB
, or TEXT
column types.CHAR
、VARCHAR
、BLOB
或TEXT
列类型的列前缀。
Clients can connect to MySQL Server using several protocols:客户端可以使用几种协议连接到MySQL服务器:
Clients can connect using TCP/IP sockets on any platform.客户端可以在任何平台上使用TCP/IP套接字进行连接。
On Windows systems, clients can connect using named pipes if the server is started with the 在Windows系统上,如果服务器启动时启用了named_pipe
system variable enabled. named_pipe
系统变量,则客户端可以使用命名管道进行连接。Windows servers also support shared-memory connections if started with the 如果在启用shared_memory
system variable enabled. shared_memory
系统变量的情况下启动,Windows服务器还支持共享内存连接。Clients can connect through shared memory by using the 客户机可以使用--protocol=memory
option.--protocol=memory
选项通过共享内存进行连接。
On Unix systems, clients can connect using Unix domain socket files.在Unix系统上,客户端可以使用Unix域套接字文件进行连接。
MySQL client programs can be written in many languages. MySQL客户端程序可以用多种语言编写。A client library written in C is available for clients written in C or C++, or for any language that provides C bindings.C中编写的客户端库可用于C或C++编写的客户端,或提供C绑定的任何语言。
APIs for C, C++, Eiffel, Java, Perl, PHP, Python, Ruby, and Tcl are available, enabling MySQL clients to be written in many languages. 对于C、C++、Eiffel、java、perl、php、python、Ruby和TCL,API是可用的,使MySQL客户端可以用多种语言编写。See Chapter 29, Connectors and APIs.参见第29章,连接器和API。
The Connector/ODBC (MyODBC) interface provides MySQL support for client programs that use ODBC (Open Database Connectivity) connections. Connector/ODBC(MyODBC)接口为使用ODBC(开放数据库连接)连接的客户机程序提供MySQL支持。For example, you can use MS Access to connect to your MySQL server. 例如,可以使用MS-Access连接到MySQL服务器。Clients can be run on Windows or Unix. 客户端可以在Windows或Unix上运行。Connector/ODBC source is available. 连接器/ODBC源可用。All ODBC 2.5 functions are supported, as are many others. 所有ODBC 2.5函数都受支持,其他许多函数也受支持。See MySQL Connector/ODBC Developer Guide.请参阅MySQL Connector/ODBC开发人员指南。
The Connector/J interface provides MySQL support for Java client programs that use JDBC connections. Connector/J接口为使用JDBC连接的Java客户机程序提供MySQL支持。Clients can be run on Windows or Unix. 客户端可以在Windows或Unix上运行。Connector/J source is available. 连接器/J源可用。See MySQL Connector/J 5.1 Developer Guide.请参阅MySQL Connector/j5.1开发人员指南。
MySQL Connector/NET enables developers to easily create .NET applications that require secure, high-performance data connectivity with MySQL. MySQL Connector/NET使开发人员能够轻松创建需要与MySQL安全、高性能数据连接的.NET应用程序。It implements the required ADO.NET interfaces and integrates into ADO.NET aware tools. 它实现了所需的ADO.NET接口,并集成到支持ADO.NET的工具中。Developers can build applications using their choice of .NET languages. 开发人员可以使用自己选择的.NET语言构建应用程序。MySQL Connector/NET is a fully managed ADO.NET driver written in 100% pure C#. MySQL Connector/NET是一个完全托管的ADO.NET驱动程序,用100%纯C语言编写。See MySQL Connector/NET Developer Guide.请参阅MySQL Connector/NET开发人员指南。
The server can provide error messages to clients in many languages. 服务器可以用多种语言向客户端提供错误消息。See Section 10.12, “Setting the Error Message Language”.参见第10.12节,“设置错误消息语言”。
Full support for several different character sets, including 完全支持多种不同的字符集,包括latin1
(cp1252), german
, big5
, ujis
, several Unicode character sets, and more. latin1
(cp1252)、german
、big5
、ujis
、多种Unicode字符集等。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. 排序和比较是根据默认字符集和排序规则进行的。is possible to change this when the MySQL server is started (see Section 10.3.2, “Server Character Set and Collation”). 可以在MySQL服务器启动时更改此设置(请参阅第10.3.2节,“服务器字符集和排序规则”)。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.MySQL服务器支持许多不同的字符集,这些字符集可以在编译时和运行时指定。
The server time zone can be changed dynamically, and individual clients can specify their own time zone. 服务器时区可以动态更改,各个客户端可以指定自己的时区。See Section 5.1.15, “MySQL Server Time Zone Support”.请参阅第5.1.15节,“MySQL服务器时区支持”。
MySQL includes several client and utility programs. MySQL包括几个客户端和实用程序。These include both command-line programs such as mysqldump and mysqladmin, and graphical programs such as MySQL Workbench.其中包括mysqldump和mysqladmin等命令行程序,以及MySQL Workbench等图形化程序。
MySQL Server has built-in support for SQL statements to check, optimize, and repair tables. MySQL服务器内置了对SQL语句的支持,可以检查、优化和修复表。These statements are available from the command line through the mysqlcheck client. 这些语句可以从命令行通过mysqlcheck客户端获得。MySQL also includes myisamchk, a very fast command-line utility for performing these operations on MySQL还包括myisamchk,这是一个非常快速的命令行实用程序,用于在MyISAM
tables. MyISAM
表上执行这些操作。See Chapter 4, MySQL Programs.参见第4章,MySQL程序。
MySQL programs can be invoked with the MySQL程序可以通过--help
or -?
option to obtain online assistance.--help
或-?
获取在线帮助的选项。