What Is New in MySQL 5.7(MySQL 5.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大小需要一个表的副本(算法=副本)。



后续再接再厉。。。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值