What Is New in MySQL 5.7(MySQL 5.7的新特性),mysql5.7

來源:互聯網
上載者:User

What Is New in MySQL 5.7(MySQL 5.7的新特性),mysql5.7

1.4 What Is New in MySQL 5.7

1.4 MySQL 5.7的新特性


This section summarizes what has been added to, deprecated in, and removed from MySQL 5.7.

本節總結了那些已被添加到的,過時的,並從MySQL 5.7中移除的特性。

• Added Features

•添加功能

• Deprecated Features

•過時的特點

• Removed Features

•刪除的功能


Added Features

添加功能

The following features have been added to MySQL 5.7:

下面的功能已被添加到MySQL 5.7:

• Security improvements.   The server now requires account rows in the mysql.user table to have  a nonempty plugin column value and disables accounts with an empty value. For server upgrade instructions,see Section 2.10.1.3, “Upgrading from MySQL 5.6 to 5.7”.  DBAs are advised to also convert accounts that use the mysql_old_password authentication plugin to use mysql_native_password instead,because support for mysql_old_password has been removed.For account upgrade
instructions, see Section 6.3.9.3, “Migrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin”.

•安全改進。現在的伺服器要求賬戶在mysql.user表中的行有一個空值非空列值外掛程式和禁用有空值的帳戶。伺服器升級指令,見第2.10.1.3,“從MySQL 5.6升級到5.7”。

DBA們應同時轉換帳戶使用使用mysql_native_password 來替換mysql_old_password認證外掛程式,因為支援mysql_old_password已被刪除。帳戶升級說明,見第6.3.9.3, “Migrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin”.


MySQL now enables database administrators to establish a policy for automatic password expiration:Any user who connects to the server using an account for which the password is past its permitted  lifetime must change the passwor. For more information, see Section 6.3.6, “Password Expiration Policy”.MySQL deployments installed using mysql_install_db now are secure by default.The following changes have been implemented as the default deployment characteristics:

MySQL資料庫管理員現在可以建立一個自動密碼到期策略:任何使用者串連到伺服器使用一個帳戶的密碼超過了允許的生命週期就必須更改密碼。有關更多資訊,請參見第6.3.6,“密碼到期政策”。現在MySQL部署安裝預設使用mysql_install_db是安全的。以下的變化已被作為預設部署的特點實現了:

• The installation process creates only a single root account, 'root'@'localhost', automatically generates a random password for this account, and marks the password expire. The MySQL administrator must connect as root using the random password and use SET PASSWORD to select a new password. The random password is found in the $HOME/.mysql_secret file.

•安裝過程只建立一個單一的root帳戶,'root'@'localhost',自動產生這個帳戶的隨機密碼,j並將該密碼標記為到期。MySQL管理員必須為根使用隨機密碼串連和使用設定密碼的選擇新密碼。隨機密碼是在$HOME/.mysql_secret檔案。

• Installation creates no anonymous-user accounts.

•安裝建立任何匿名使用者帳戶。

• Installation creates no test database.

•安裝建立沒有測試資料庫。

• SQL mode changes.  Strict SQL mode for transactional storage engines (STRICT_TRANS_TABLES) is now enabled by default.

•SQL模式的變化。嚴格SQL模式的事務儲存引擎(strict_trans_tables)現在是預設啟用。

Implementation for the ONLY_FULL_GROUP_BY SQL mode has been made more sophisticated,to no longer reject deterministic queries that previously were rejected. In consequence, this mode is now enabled by default, to prohibit only nondeterministic queries containing expressions not guaranteed to be uniquely determined within a group.

為only_full_group_by SQL模式實現了更複雜的,不再拒絕確定性查詢,先前被拒絕。因此,這種模式是現在預設啟用,禁止只含有不確定性查詢不能保證運算式唯一確定的組內。


The changes to the default SQL mode result in a default sql_mode system variable value with these modes enabled: ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ENGINE_SUBSTITUTION.

更改預設的SQL模式導致違約sql_mode系統變數的值與這些模式啟用:only_full_group_by,strict_trans_tables,no_engine_substitution。


• Online ALTER TABLE. 

•線上修改表。

ALTER TABLE now supports a RENAME INDEX clause that renames an index. The change is made in place without a table-copy operation. It works for all storage engines. See Section 13.1.6, “ALTER TABLE Syntax”.











修改表現在支援重新命名,重新命名一個索引條款 。更改的地方沒有表複製操作。它為所有的儲存引擎的作品。看到第13.1.6,“修改表的文法。




• InnoDB enhancements.  These InnoDB enhancements were added:

•InnoDB增強。增加了這些InnoDB增強:

• VARCHAR size may be increased using an in-place ALTER TABLE, as in this example:
•varchar的大小可以通過在修改表增加,如下面的例子:
ALTER TABLE t1 ALGORITHM=INPLACE, CHANGE COLUMN c1 c1 VARCHAR(255);
This is true as long as the number of length bytes required by a VARCHAR column remains the same.For VARCHAR values of 0 to 255, one length byte is required to encode the value. For VARCHAR values of 256 bytes or more, two length bytes are required. As a result, in-place ALTER TABLE only supports increasing VARCHAR size from 0 to 255 bytes or increasing VARCHAR size from a value equal to or greater than 256 bytes.

這是真的只要一個VARCHAR列長度的位元組的數目是相同的。對於varchar值0到255,一個長度位元組編碼所需的值。對於varchar值256位元組或更多,需要兩個長度位元組。作為一個結果,在ALTER TABLE只支援增加varchar的大小從0到255位元組或增加varchar的大小等於或大於256位元組。


In-place ALTER TABLE does not support increasing VARCHAR size from less than 256 bytes to a value equal to or greater than 256 bytes. In this case, the number of required length bytes would change from 1 to 2, which is only supported by a table copy (ALGORITHM=COPY). For example, attempting to change VARCHAR column size from 255 to 256 using in-place ALTER TABLE would return an error:

在修改表不支援增加小於256位元組varchar大小的值等於或大於256位元組。在這種情況下,所需長度的位元組數的變化從1到2,這是由一個表複製僅支援(演算法=副本)。例如,試圖改變VARCHAR列的大小從255到256使用ALTER TABLE將返回一個錯誤的地方:

ALTER TABLE t1 ALGORITHM=INPLACE, CHANGE COLUMN c1 c1 VARCHAR(256);
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change
column type INPLACE. Try ALGORITHM=COPY.

Decreasing VARCHAR size using in-place ALTER TABLE is not supported. Decreasing VARCHAR size requires a table copy (ALGORITHM=COPY).

減少使用varchar大小地方修改表不支援。降低varchar大小需要一個表的副本(演算法=副本)。



後續再接再厲。。。



相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.