This section summarizes what has been added to, deprecated in, and removed from MySQL 5.7. A companion section lists MySQL server options and variables that have been added, deprecated, or removed in MySQL 5.7. See Section 1.5, “Server and Status Variables and Options Added, Deprecated, or Removed in MySQL 5.7”.
The following features have been added to MySQL 5.7:
Security improvements. These security enhancements were added:
The server now requires account rows in the
mysql.usertable to have a nonemptyplugincolumn value and disables accounts with an empty value. For server upgrade instructions, see Section 2.11.1.1, “Changes Affecting Upgrades to MySQL 5.7”. DBAs are advised to also convert accounts that use themysql_old_passwordauthentication plugin to usemysql_native_passwordinstead, because support formysql_old_passwordhas been removed. For account upgrade instructions, see Section 6.5.1.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 password. For more information, see Section 6.3.6, “Password Expiration Policy”.
Administrators can lock and unlock accounts for better control over who can log in. For more information, see Section 6.3.10, “User Account Locking”.
To make it easier to support secure connections, MySQL servers compiled using OpenSSL can automatically generate missing SSL and RSA certificate and key files at startup. See Section 6.4.6.1, “Creating SSL and RSA Certificates and Keys using MySQL”.
All servers (whether compiled using OpenSSL or yaSSL), if not configured for SSL explicitly, attempt to enable SSL automatically at startup if they find the requisite SSL files in the data directory. See Section 6.4.4, “Configuring MySQL to Use Secure Connections”.
In addition, MySQL distributions include a mysql_ssl_rsa_setup utility that can be invoked manually to create SSL and RSA key and certificate files. For more information, see Section 4.4.5, “mysql_ssl_rsa_setup — Create SSL/RSA Files”.
MySQL deployments installed using mysqld --initialize are secure by default. The following changes have been implemented as the default deployment characteristics:
The installation process creates only a single
rootaccount,'root'@'localhost', automatically generates a random password for this account, and marks the password expired. The MySQL administrator must connect asrootusing the random password and assign a new password. (The server writes the random password to the error log.)Installation creates no anonymous-user accounts.
Installation creates no
testdatabase.
For more information, see Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”.
SQL mode changes. Strict SQL mode for transactional storage engines (
STRICT_TRANS_TABLES) is now enabled by default.Implementation for the
ONLY_FULL_GROUP_BYSQL 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.The
ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE, andNO_ZERO_IN_DATESQL modes are now deprecated but enabled by default. The long term plan is to have them included in strict SQL mode and to remove them as explicit modes in a future MySQL release. See SQL Mode Changes in MySQL 5.7.The changes to the default SQL mode result in a default
sql_modesystem variable value with these modes enabled:ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER, andNO_ENGINE_SUBSTITUTION.Online ALTER TABLE.
ALTER TABLEnow supports aRENAME INDEXclause 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.8, “ALTER TABLE Syntax”.ngram and MeCab full-text parser plugins. MySQL provides a built-in full-text ngram parser plugin that supports Chinese, Japanese, and Korean (CJK), and an installable MeCab full-text parser plugin for Japanese.
For more information, see Section 12.9.8, “ngram Full-Text Parser”, and Section 12.9.9, “MeCab Full-Text Parser Plugin”.
InnoDB enhancements. These
InnoDBenhancements were added:VARCHARsize may be increased using an in-placeALTER TABLE, as in this example: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
VARCHARcolumn remains the same. ForVARCHARvalues of 0 to 255, one length byte is required to encode the value. ForVARCHARvalues of 256 bytes or more, two length bytes are required. As a result, in-placeALTER TABLEonly supports increasingVARCHARsize from 0 to 255 bytes or increasingVARCHARsize from a value equal to or greater than 256 bytes.In-place
ALTER TABLEdoes not support increasingVARCHARsize 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 changeVARCHARcolumn size from 255 to 256 using in-placeALTER TABLEwould return an error: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
VARCHARsize using in-placeALTER TABLEis not supported. DecreasingVARCHARsize requires a table copy (ALGORITHM=COPY).DDL performance for
InnoDBtemporary tables is improved through optimization ofCREATE TABLE,DROP TABLE,TRUNCATE TABLE, andALTER TABLEstatements.InnoDBtemporary table metadata is no longer stored toInnoDBsystem tables. Instead, a new table,INNODB_TEMP_TABLE_INFO, provides users with a snapshot of active temporary tables. The table contains metadata and reports on all user and system-created temporary tables that are active within a givenInnoDBinstance. The table is created when the firstSELECTstatement is run against it.InnoDBnow supports MySQL-supported spatial data types. Prior to this release,InnoDBwould store spatial data as binaryBLOBdata.BLOBremains the underlying data type but spatial data types are now mapped to a newInnoDBinternal data type,DATA_GEOMETRY.There is now a separate tablespace for all non-compressed
InnoDBtemporary tables. The new tablespace is always recreated on server startup and is located inDATADIRby default. A newly added configuration file option,innodb_temp_data_file_path, allows for a user-defined temporary data file path.innochecksum functionality is enhanced with several new options and extended capabilities. See Section 4.6.1, “innochecksum — Offline InnoDB File Checksum Utility”.
A new type of non-redo undo log for both normal and compressed temporary tables and related objects now resides in the temporary tablespace. For more information, see Section 14.4.12.1, “InnoDB Temporary Table Undo Logs”.
InnoDBbuffer pool dump and load operations are enhanced. A new system variable,innodb_buffer_pool_dump_pct, allows you to specify the percentage of most recently used pages in each buffer pool to read out and dump. When there is other I/O activity being performed byInnoDBbackground tasks,InnoDBattempts to limit the number of buffer pool load operations per second using theinnodb_io_capacitysetting.Support is added to
InnoDBfor full-text parser plugins. For information about full-text parser plugins, see Full-Text Parser Plugins and Section 28.2.4.4, “Writing Full-Text Parser Plugins”.InnoDBsupports multiple page cleaner threads for flushing dirty pages from buffer pool instances. A new system variable,innodb_page_cleaners, is used to specify the number of page cleaner threads. The default value of1maintains the previous configuration in which there is a single page cleaner thread. This enhancement builds on work completed in MySQL 5.6, which introduced a single page cleaner thread to offload buffer pool flushing work from theInnoDBmaster thread.Online DDL support is extended to the following operations for regular and partitioned
InnoDBtables:ALTER TABLE ... ENGINE=INNODB(when run on anInnoDBtable)Online DDL support reduces table rebuild time and permits concurrent DML. See Section 14.13.1, “Online DDL Overview”.
The Fusion-io Non-Volatile Memory (NVM) file system on Linux provides atomic write capability, which makes the
InnoDBdoublewrite buffer redundant. TheInnoDBdoublewrite buffer is automatically disabled for system tablespace files (ibdata files) located on Fusion-io devices that support atomic writes.InnoDBsupports the Transportable Tablespace feature for partitionedInnoDBtables and individualInnoDBtable partitions. This enhancement eases backup procedures for partitioned tables and enables copying of partitioned tables and individual table partitions between MySQL instances. For additional information, see Section 14.7.6, “Copying File-Per-Table Tablespaces to Another Instance”.The
innodb_buffer_pool_sizeparameter is dynamic, allowing you to resize the buffer pool without restarting the server. The resizing operation, which involves moving pages to a new location in memory, is performed in chunks. Chunk size is configurable using the newinnodb_buffer_pool_chunk_sizeconfiguration option. You can monitor resizing progress using the newInnodb_buffer_pool_resize_statusstatus variable. For more information, see Configuring InnoDB Buffer Pool Size Online.Multi-threaded page cleaner support (
innodb_page_cleaners) is extended to shutdown and recovery phases.InnoDBsupports indexing of spatial data types usingSPATIALindexes, including use ofALTER TABLE ... ALGORITHM=INPLACEfor online operations (ADD SPATIAL INDEX).InnoDBperforms a bulk load when creating or rebuilding indexes. This method of index creation is known as a “sorted index build”. This enhancement, which improves the efficiency of index creation, also applies to full-text indexes. A new global configuration option,innodb_fill_factor, defines the percentage of space on each page that is filled with data during a sorted index build, with the remaining space reserved for future index growth. For more information, see Section 14.8.2.3, “Sorted Index Builds”.A new log record type (
MLOG_FILE_NAME) is used to identify tablespaces that have been modified since the last checkpoint. This enhancement simplifies tablespace discovery during crash recovery and eliminates scans on the file system prior to redo log application. For more information about the benefits of this enhancement, see Tablespace Discovery During Crash Recovery.This enhancement changes the redo log format, requiring that MySQL be shut down cleanly before upgrading to or downgrading from MySQL 5.7.5.
You can truncate undo logs that reside in undo tablespaces. This feature is enabled using the
innodb_undo_log_truncateconfiguration option. For more information, see Section 14.7.8, “Truncating Undo Logs That Reside in Undo Tablespaces”.InnoDBsupports native partitioning. Previously,InnoDBrelied on theha_partitionhandler, which creates a handler object for each partition. With native partitioning, a partitionedInnoDBtable uses a single partition-aware handler object. This enhancement reduces the amount of memory required for partitionedInnoDBtables.As of MySQL 5.7.9, mysql_upgrade looks for and attempts to upgrade partitioned
InnoDBtables that were created using theha_partitionhandler. Also in MySQL 5.7.9 and later, you can upgrade such tables by name in the mysql client usingALTER TABLE ... UPGRADE PARTITIONING.InnoDBsupports the creation of general tablespaces usingCREATE TABLESPACEsyntax.CREATE TABLESPACE `tablespace_name` ADD DATAFILE 'file_name.ibd' [FILE_BLOCK_SIZE = n]General tablespaces can be created outside of the MySQL data directory, are capable of holding multiple tables, and support tables of all row formats.
Tables are added to a general tablespace using
CREATE TABLEortbl_name... TABLESPACE [=]tablespace_nameALTER TABLEsyntax.tbl_nameTABLESPACE [=]tablespace_nameFor more information, see Section 14.7.9, “InnoDB General Tablespaces”.
DYNAMICreplacesCOMPACTas the implicit default row format forInnoDBtables. A new configuration option,innodb_default_row_format, specifies the defaultInnoDBrow format. For more information, see Section 14.11.2, “Specifying the Row Format for a Table”.As of MySQL 5.7.11,
InnoDBsupports data-at-rest encryption for file-per-table tablespaces. Encryption is enabled by specifying theENCRYPTIONoption when creating or altering anInnoDBtable. This feature, referred to asInnoDBtablespace encryption, relies on akeyringplugin for encryption key management. For more information, see Section 6.5.4, “The MySQL Keyring”, and Section 14.7.10, “InnoDB Tablespace Encryption”.
JSON support. Beginning with MySQL 5.7.8, MySQL supports a native
JSONtype. JSON values are not stored as strings, instead using an internal binary format that permits quick read access to document elements. JSON documents stored inJSONcolumns are automatically validated whenever they are inserted or updated, with an invalid document producing an error. JSON documents are normalized on creation, and can be compared using most comparison operators such as=,<,<=,>,>=,<>,!=, and<=>; for information about supported operators as well as precedence and other rules that MySQL follows when comparingJSONvalues, see Comparison and Ordering of JSON Values.MySQL 5.7.8 also introduces a number of functions for working with
JSONvalues. These functions include those listed here:Functions that create
JSONvalues:JSON_ARRAY(),JSON_MERGE(), andJSON_OBJECT(). See Section 12.16.2, “Functions That Create JSON Values”.Functions that search
JSONvalues:JSON_CONTAINS(),JSON_CONTAINS_PATH(),JSON_EXTRACT(),JSON_KEYS(), andJSON_SEARCH(). See Section 12.16.3, “Functions That Search JSON Values”.Functions that modify
JSONvalues:JSON_APPEND(),JSON_ARRAY_APPEND(),JSON_ARRAY_INSERT(),JSON_INSERT(),JSON_QUOTE(),JSON_REMOVE(),JSON_REPLACE(),JSON_SET(), andJSON_UNQUOTE(). See Section 12.16.4, “Functions That Modify JSON Values”.Functions that provide information about
JSONvalues:JSON_DEPTH(),JSON_LENGTH(),JSON_TYPE(), andJSON_VALID(). See Section 12.16.5, “Functions That Return JSON Value Attributes”.
In MySQL 5.7.9 and later, you can use
as shorthand forcolumn->pathJSON_EXTRACT(. This works as an alias for a column wherever a column identifier can occur in an SQL statement, includingcolumn,path)WHERE,ORDER BY, andGROUP BYclauses. This includesSELECT,UPDATE,DELETE,CREATE TABLE, and other SQL statements. The left hand side must be aJSONcolumn identifier (and not an alias). The right hand side is a quoted JSON path expression which is evaluated against the JSON document returned as the column value.See Section 12.16.3, “Functions That Search JSON Values”, for more information about
->andJSON_EXTRACT(). For information about JSON path support in MySQL 5.7, see Searching and Modifying JSON Values. See also Indexing a Generated Column to Provide a JSON Column Index.System and status variables. System and status variable information is now available in Performance Schema tables, in preference to use of
INFORMATION_SCHEMAtables to obtain these variable. This also affects the operation of theSHOW VARIABLESandSHOW STATUSstatements. The value of theshow_compatibility_56system variable affects the output produced from and privileges required for system and status variable statements and tables. For details, see the description of that variable in Section 5.1.5, “Server System Variables”.NoteThe default for
show_compatibility_56isOFF. Applications that require 5.6 behavior should set this variable toONuntil such time as they have been migrated to the new behavior for system variables and status variables. See Section 25.19, “Migrating to Performance Schema System and Status Variable Tables”sys schema. MySQL distributions now include the
sysschema, which is a set of objects that help DBAs and developers interpret data collected by the Performance Schema.sysschema objects can be used for typical tuning and diagnosis use cases. For more information, see Chapter 26, MySQL sys Schema.Condition handling. MySQL now supports stacked diagnostics areas. When the diagnostics area stack is pushed, the first (current) diagnostics area becomes the second (stacked) diagnostics area and a new current diagnostics area is created as a copy of it. Within a condition handler, executed statements modify the new current diagnostics area, but
GET STACKED DIAGNOSTICScan be used to inspect the stacked diagnostics area to obtain information about the condition that caused the handler to activate, independent of current conditions within the handler itself. (Previously, there was a single diagnostics area. To inspect handler-activating conditions within a handler, it was necessary to check this diagnostics area before executing any statements that could change it.) See Section 13.6.7.3, “GET DIAGNOSTICS Syntax”, and Section 13.6.7.7, “The MySQL Diagnostics Area”.Optimizer. These optimizer enhancements were added:
EXPLAINcan be used to obtain the execution plan for an explainable statement executing in a named connection:EXPLAIN [options] FOR CONNECTION connection_id;For more information, see Section 8.8.4, “Obtaining Execution Plan Information for a Named Connection”.
It is possible to provide hints to the optimizer within individual SQL statements, which enables finer control over statement execution plans than can be achieved using the
optimizer_switchsystem variable. Hints are also permitted in statements used withEXPLAIN, enabling you to see how hints affect execution plans. For more information, see Section 8.9.2, “Optimizer Hints”.
Triggers. Previously, a table could have at most one trigger for each combination of trigger event (
INSERT,UPDATE,DELETE) and action time (BEFORE,AFTER). This limitation has been lifted and multiple triggers are permitted. For more information, see Section 23.3, “Using Triggers”.Logging. These logging enhancements were added:
Previously, on Unix and Unix-like systems, MySQL support for sending the server error log to
syslogwas implemented by having mysqld_safe capture server error output and pass it tosyslog. The server now includes nativesyslogsupport, which has been extended to include Windows. For more information about sending server error output tosyslog, see Section 5.4.2, “The Error Log”.The mysql client now has a
--syslogoption that causes interactive statements to be sent to the systemsyslogfacility. Logging is suppressed for statements that match the default “ignore” pattern list ("*IDENTIFIED*:*PASSWORD*"), as well as statements that match any patterns specified using the--histignoreoption. See Section 4.5.1.3, “mysql Logging”.
Generated Columns. MySQL now supports the specification of generated columns in
CREATE TABLEandALTER TABLEstatements. Values of a generated column are computed from an expression specified at column creation time. Generated columns can be virtual (computed “on the fly” when rows are read) or stored (computed when rows are inserted or updated). For more information, see Section 13.1.18.8, “CREATE TABLE and Generated Columns”.mysql client. Previously, Control+C in mysql interrupted the current statement if there was one, or exited mysql if not. Now Control+C interrupts the current statement if there was one, or cancels any partial input line otherwise, but does not exit.
Database name rewriting with mysqlbinlog. Renaming of databases by mysqlbinlog when reading from binary logs written using the row-based format is now supported using the
--rewrite-dboption added in MySQL 5.7.1.This option uses the format
--rewrite-db='. You can implement multiple rewrite rules, by specifying the option multiple times.dboldname->dbnewname'HANDLER with partitioned tables. The
HANDLERstatement may now be used with user-partitioned tables. Such tables may use any of the available partitioning types (see Section 22.2, “Partitioning Types”).Index condition pushdown support for partitioned tables. Queries on partitioned tables using the
InnoDBorMyISAMstorage engine may employ the index condition pushdown optimization that was introduced in MySQL 5.6. See Section 8.2.1.5, “Index Condition Pushdown Optimization”, for more information.WITHOUT VALIDATION support for ALTER TABLE ... EXCHANGE PARTITION. As of MySQL 5.7.5,
ALTER TABLE ... EXCHANGE PARTITIONsyntax includes an optional{WITH|WITHOUT} VALIDATIONclause. WhenWITHOUT VALIDATIONis specified,ALTER TABLE ... EXCHANGE PARTITIONdoes not perform row-by-row validation when exchanging a populated table with the partition, permitting database administrators to assume responsibility for ensuring that rows are within the boundaries of the partition definition.WITH VALIDATIONis the default behavior and need not be specified explicitly. For more information, see Section 22.3.3, “Exchanging Partitions and Subpartitions with Tables”.Master dump thread improvements. The master dump thread was refactored to reduce lock contention and improve master throughput. Previous to MySQL 5.7.2, the dump thread took a lock on the binary log whenever reading an event; in MySQL 5.7.2 and later, this lock is held only while reading the position at the end of the last successfully written event. This means both that multiple dump threads are now able to read concurrently from the binary log file, and that dump threads are now able to read while clients are writing to the binary log.
Globalization improvements. MySQL 5.7.4 includes a
gb18030character set that supports the China National Standard GB18030 character set. For more information about MySQL character set support, see Section 10.1, “Character Set Support”.Changing the replication master without STOP SLAVE. In MySQL 5.7.4 and later, the strict requirement to execute
STOP SLAVEprior to issuing anyCHANGE MASTER TOstatement is removed. Instead of depending on whether the slave is stopped, the behavior ofCHANGE MASTER TOnow depends on the states of the slave SQL thread and slave I/O threads; which of these threads is stopped or running now determines the options that can or cannot be used with aCHANGE MASTER TOstatement at a given point in time. The rules for making this determination are listed here:If the SQL thread is stopped, you can execute
CHANGE MASTER TOusing any combination ofRELAY_LOG_FILE,RELAY_LOG_POS, andMASTER_DELAYoptions, even if the slave I/O thread is running. No other options may be used with this statement when the I/O thread is running.If the I/O thread is stopped, you can execute
CHANGE MASTER TOusing any of the options for this statement (in any allowed combination) exceptRELAY_LOG_FILE,RELAY_LOG_POS, orMASTER_DELAY, even when the SQL thread is running. These three options may not be used when the I/O thread is running.Both the SQL thread and the I/O thread must be stopped before issuing
CHANGE MASTER TO ... MASTER_AUTO_POSITION = 1.
You can check the current state of the slave SQL and I/O threads using
SHOW SLAVE STATUS.If you are using statement-based replication and temporary tables, it is possible for a
CHANGE MASTER TOstatement following aSTOP SLAVEstatement to leave behind temporary tables on the slave. As part of this set of improvements, a warning is now issued wheneverCHANGE MASTER TOis issued followingSTOP SLAVEwhen statement-based replication is in use andSlave_open_temp_tablesremains greater than 0.For more information, see Section 13.4.2.1, “CHANGE MASTER TO Syntax”, and Section 16.3.7, “Switching Masters During Failover”.
Test suite. The MySQL test suite now uses
InnoDBas the default storage engine.Multi-source replication is now possible. MySQL Multi-Source Replication adds the ability to replicate from multiple masters to a slave. MySQL Multi-Source Replication topologies can be used to back up multiple servers to a single server, to merge table shards, and consolidate data from multiple servers to a single server. See Section 16.1.4, “MySQL Multi-Source Replication”.
As part of MySQL Multi-Source Replication, replication channels have been added. Replication channels enable a slave to open multiple connections to replicate from, with each channel being a connection to a master. See Section 16.2.3, “Replication Channels”.
Group Replication Performance Schema tables. MySQL 5.7 adds a number of new tables to the Performance Schema to provide information about replication groups and channels. These include the following tables:
All of these tables were added in MySQL 5.7.2, except for
replication_group_membersandreplication_group_member_stats, which were added in MySQL 5.7.6. For more information, see Section 25.11.11, “Performance Schema Replication Tables”.Group Replication SQL. The following statements were added in MySQL 5.7.6 for controlling Group Replication:
For more information, see Section 13.4.3, “SQL Statements for Controlling Group Replication”.
The following features are deprecated in MySQL 5.7 and may be or will be removed in a future series. Where alternatives are shown, applications should be updated to use them.
The
ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE, andNO_ZERO_IN_DATESQL modes are now deprecated but enabled by default. The long term plan is to have them included in strict SQL mode and to remove them as explicit modes in a future MySQL release.The deprecated
ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE, andNO_ZERO_IN_DATESQL modes are still recognized so that statements that name them do not produce an error, but will be removed in a future version of MySQL. To make advance preparation for versions of MySQL in which these mode names do not exist, applications should be modified to not refer to them. See SQL Mode Changes in MySQL 5.7.Changes to account-management statements make the following features obsolete. They are now deprecated:
Using
GRANTto create users. Instead, useCREATE USER. Following this practice makes theNO_AUTO_CREATE_USERSQL mode immaterial forGRANTstatements, so it too is deprecated.Using
GRANTto modify account properties other than privilege assignments. This includes authentication, SSL, and resource-limit properties. Instead, establish such properties at account-creation time withCREATE USERor modify them afterward withALTER USER.IDENTIFIED BY PASSWORD 'syntax forhash_string'CREATE USERandGRANT. Instead, useIDENTIFIED WITHforauth_pluginAS 'hash_string'CREATE USERandALTER USER, where the'value is in a format compatible with the named plugin.hash_string'The
PASSWORD()function is deprecated and should be avoided in any context. Thus,SET PASSWORD ... = PASSWORD('syntax is also deprecated.auth_string')SET PASSWORD ... = 'syntax is not deprecated; nevertheless,auth_string'ALTER USERis now the preferred statement for assigning passwords.The
old_passwordssystem variable. Account authentication plugins can no longer be left unspecified in themysql.usertable, so any statement that assigns a password from a cleartext string can unambiguously determine the hashing method to use on the string before storing it in themysql.usertable. This rendersold_passwordssuperflous.
GROUP BYimplicitly sorts by default (that is, in the absence ofASCorDESCdesignators), but relying on implicitGROUP BYsorting in MySQL 5.7 is deprecated. To achieve a specific sort order of grouped results, it is preferable to use To produce a given sort order, use explicitASCorDESCdesignators forGROUP BYcolumns or provide anORDER BYclause.GROUP BYsorting is a MySQL extension that may change in a future release; for example, to make it possible for the optimizer to order groupings in whatever manner it deems most efficient and to avoid the sorting overhead.The
EXTENDEDandPARTITIONSkeywords for theEXPLAINstatement are deprecated. These keywords are still recognized but are now unnecessary because their effect is always enabled.The
--skip-innodboption and its synonyms (--innodb=OFF,--disable-innodb, and so forth) are deprecated. These options have no effect as of MySQL 5.7. becauseInnoDBcannot be disabled.The client-side
--ssland--ssl-verify-server-certoptions are deprecated. Use--ssl-mode=REQUIREDinstead of--ssl=1or--enable-ssl. Use--ssl-mode=DISABLEDinstead of--ssl=0,--skip-ssl, or--disable-ssl. Use--ssl-mode=VERIFY_IDENTITYinstead of--ssl-verify-server-certoptions. (The server-side--ssloption is not deprecated.)For the C API,
MYSQL_OPT_SSL_ENFORCEandMYSQL_OPT_SSL_VERIFY_SERVER_CERToptions formysql_options()correspond to the client-side--ssland--ssl-verify-server-certoptions and are deprecated. UseMYSQL_OPT_SSL_MODEwith an option value ofSSL_MODE_REQUIREDorSSL_MODE_VERIFY_IDENTITYinstead.The
log_warningssystem variable and--log-warningsserver option are deprecated. Use thelog_error_verbositysystem variable instead.The
--temp-poolserver option is deprecated.The
binlog_max_flush_queue_timesystem variable does nothing in MySQL 5.7, and is deprecated as of MySQL 5.7.9.The
innodb_support_xasystem variable, which enablesInnoDBsupport for two-phase commit in XA transactions, is deprecated as of MySQL 5.7.10.InnoDBsupport for two-phase commit in XA transactions is always enabled as of MySQL 5.7.10.The
metadata_locks_cache_sizeandmetadata_locks_hash_instancessystem variables are deprecated. These do nothing as of MySQL 5.7.4.The
sync_frmsystem variable is deprecated.The global
character_set_databaseandcollation_databasesystem variables are deprecated and will be removed in a future version of MySQL.Assigning a value to the session
character_set_databaseandcollation_databasesystem variables is deprecated and assignments produce a warning. The session variables will become read only in a future version of MySQL and assignments will produce an error. It will remain possible to access the session variables to determine the database character set and collation for the default database.The
ENCRYPT(),ENCODE(),DECODE(),DES_ENCRYPT(), andDES_DECRYPT()encryption functions are deprecated. Consider usingAES_ENCRYPT()andAES_DECRYPT()instead.The
MBREqual()spatial function is deprecated. UseMBREquals()instead.The functions described in Section 12.15.4, “Functions That Create Geometry Values from WKB Values” previously accepted either WKB strings or geometry arguments. Use of geometry arguments is deprecated. See that section for guidelines for migrating queries away from using geometry arguments.
The
INFORMATION_SCHEMAPROFILINGtable is deprecated. Use the Performance Schema instead; see Chapter 25, MySQL Performance Schema.The
INFORMATION_SCHEMAINNODB_LOCKSandINNODB_LOCK_WAITStables are deprecated, to be removed in MySQL 8.0, which provides replacement Performance Schema tables.Treatment of
\Nas a synonym forNULLin SQL statements is deprecated and is removed in MySQL 8.0; useNULLinstead.This change does not affect text file import or export operations performed with
LOAD DATA INFILEorSELECT ... INTO OUTFILE, for whichNULLcontinues to be represented by\N. See Section 13.2.6, “LOAD DATA INFILE Syntax”.PROCEDURE ANALYSE()syntax is deprecated.mysqld_safe support for
syslogoutput is deprecated. Use the native serversyslogsupport used instead. See Section 5.4.2, “The Error Log”.Conversion of pre-MySQL 5.1 database names containing special characters to 5.1 format with the addition of a
#mysql50#prefix is deprecated. Because of this, the--fix-db-namesand--fix-table-namesoptions for mysqlcheck and theUPGRADE DATA DIRECTORY NAMEclause for theALTER DATABASEstatement are also deprecated.Upgrades are supported only from one release series to another (for example, 5.0 to 5.1, or 5.1 to 5.5), so there should be little remaining need for conversion of older 5.0 database names to current versions of MySQL. As a workaround, upgrade a MySQL 5.0 installation to MySQL 5.1 before upgrading to a more recent release.
mysql_install_db functionality has been integrated into the MySQL server, mysqld. To use this capability to initialize a MySQL installation, if you previously invoked mysql_install_db manually, invoke mysqld with the
--initializeor--initialize-insecureoption, depending on whether you want the server to generate a random password for the initial'root'@'localhost'account.mysql_install_db is now deprecated, as is the special
--bootstrapoption that mysql_install_db passes to mysqld.The mysql_plugin utility is deprecated. Alternatives include loading plugins at server startup using the
--plugin-loador--plugin-load-addoption, or at runtime using theINSTALL PLUGINstatement.The
mysql_kill(),mysql_list_fields(),mysql_list_processes(), andmysql_refresh()C API functions are deprecated. The same is true of the correspondingCOM_PROCESS_KILL,COM_FIELD_LIST,COM_PROCESS_INFO, andCOM_REFRESHclient/server protocol commands. Instead, usemysql_query()to execute aKILL,SHOW COLUMNS,SHOW PROCESSLIST, orFLUSHstatement, respectively.The
mysql_shutdown()C API function is deprecated. Instead, usemysql_query()to execute aSHUTDOWNstatement.The
libmysqldembedded server library is deprecated as of MySQL 5.7.19. These are also deprecated:The mysql_config
--libmysqld-libs,--embedded-libs, and--embeddedoptionsThe CMake
WITH_EMBEDDED_SERVER,WITH_EMBEDDED_SHARED_LIBRARY, andINSTALL_SECURE_FILE_PRIV_EMBEDDEDDIRoptionsThe (undocumented) mysql
--server-argoptionThe mysqltest
--embedded-server,--server-arg, and--server-fileoptionsThe mysqltest_embedded and mysql_client_test_embedded test programs
Because
libmysqlduses an API comparable to that oflibmysqlclient, the migration path away fromlibmysqldis straightforward:Bring up a standalone MySQL server (mysqld).
Modify application code to remove API calls that are specific to
libmysqld.Modify application code to connect to the standalone MySQL server.
Modify build scripts to use
libmysqlclientrather thanlibmysqld. For example, if you use mysql_config, invoke it with the--libsoption rather than--libmysqld-libs.
The replace utility is deprecated.
Support for DTrace is deprecated.
The following items are obsolete and have been removed in MySQL 5.7. Where alternatives are shown, applications should be updated to use them.
Support for passwords that use the older pre-4.1 password hashing format is removed, which involves the following changes. Applications that use any feature no longer supported must be modified.
The
mysql_old_passwordauthentication plugin is removed. Accounts that use this plugin are disabled at startup and the server writes an “unknown plugin” message to the error log. For instructions on upgrading accounts that use this plugin, see Section 6.5.1.3, “Migrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin”.The
--secure-authoption to the server and client programs is the default, but is now a no-op. It is deprecated and will be removed in a future MySQL release.The
--skip-secure-authoption to the server and client programs is no longer supported and using it produces an error.The
secure_authsystem variable permits only a value of 1; a value of 0 is no longer permitted.For the
old_passwordssystem variable, a value of 1 (produce pre-4.1 hashes) is no longer permitted.The
OLD_PASSWORD()function is removed.
In MySQL 5.6.6, the
YEAR(2)data type was deprecated. Support forYEAR(2)is now removed. Once you upgrade to MySQL 5.7.5 or higher, any remainingYEAR(2)columns must be converted toYEAR(4)to become usable again. For conversion strategies, see Section 11.3.4, “YEAR(2) Limitations and Migrating to YEAR(4)”. For example, run mysql_upgrade after upgrading.The
innodb_mirrored_log_groupssystem variable. The only supported value was 1, so it had no purpose.The
storage_enginesystem variable. Usedefault_storage_engineinstead.The
thread_concurrencysystem variable.The
timed_mutexessystem variable. It does nothing and has no effect.The
IGNOREclause forALTER TABLE.INSERT DELAYEDis no longer supported. The server recognizes but ignores theDELAYEDkeyword, handles the insert as a nondelayed insert, and generates anER_WARN_LEGACY_SYNTAX_CONVERTEDwarning. (“INSERT DELAYED is no longer supported. The statement was converted to INSERT.”) Similarly,REPLACE DELAYEDis handled as a nondelayed replace. TheDELAYEDkeyword will be removed in a future release.In addition, several
DELAYED-related options or features were removed:The
--delayed-insertoption for mysqldump.The
COUNT_WRITE_DELAYED,SUM_TIMER_WRITE_DELAYED,MIN_TIMER_WRITE_DELAYED,AVG_TIMER_WRITE_DELAYED, andMAX_TIMER_WRITE_DELAYEDcolumns of the Performance Schematable_lock_waits_summary_by_tabletable.mysqlbinlog no longer writes comments mentioning
INSERT DELAYED.
Database symlinking on Windows using for
.symfiles has been removed because it is redundant with native symlink support available using mklink. Any.symfile symbolic links will be ignored and should be replaced with symlinks created using mklink. See Section 8.12.3.3, “Using Symbolic Links for Databases on Windows”.The unused
--basedir,--datadir, and--tmpdiroptions for mysql_upgrade were removed.Previously, program options could be specified in full or as any unambiguous prefix. For example, the
--compressoption could be given to mysqldump as--compr, but not as--compbecause the latter is ambiguous. Option prefixes are no longer supported; only full options are accepted. This is because prefixes can cause problems when new options are implemented for programs and a prefix that is currently unambiguous might become ambiguous in the future. Some implications of this change:The
--key-bufferoption must now be specified as--key-buffer-size.The
--skip-grantoption must now be specified as--skip-grant-tables.
SHOW ENGINE INNODB MUTEXoutput is removed. Comparable information can be generated by creating views on Performance Schema tables.The
InnoDBTablespace Monitor andInnoDBTable Monitor are removed. For the Table Monitor, equivalent information can be obtained fromInnoDBINFORMATION_SCHEMAtables.The specially named tables used to enable and disable the standard
InnoDBMonitor andInnoDBLock Monitor (innodb_monitorandinnodb_lock_monitor) are removed and replaced by two dynamic system variables:innodb_status_outputandinnodb_status_output_locks. For additional information, see Section 14.17, “InnoDB Monitors”.The
innodb_use_sys_mallocandinnodb_additional_mem_pool_sizesystem variables, which were deprecated in MySQL 5.6.3, were removed.The msql2mysql, mysql_convert_table_format, mysql_find_rows, mysql_fix_extensions, mysql_setpermission, mysql_waitpid, mysql_zap, mysqlaccess, and mysqlbug utilities.
The mysqlhotcopy utility. Alternatives include mysqldump and MySQL Enterprise Backup.
The binary-configure.sh script.
The
INNODB_PAGE_ATOMIC_REF_COUNTCMake option is removed.The
innodb_create_intrinsicoption is removed.The
innodb_optimize_point_storageoption and related internal data types (DATA_POINTandDATA_VAR_POINT) were removed.The
innodb_log_checksum_algorithmoption is removed.