2. Safe Harbor Agreement
THE FOLLOWING IS INTENDED TO OUTLINE OUR GENERAL PRODUCT DIRECTION. IT IS INTENDED FOR INFORMATION
PURPOSES ONLY, AND MAY NOT BE INCORPORATED INTO ANY CONTRACT. IT IS NOT A COMMITMENT TO DELIVER ANY
MATERIAL, CODE, OR FUNCTIONALITY, AND SHOULD NOT BE RELIED UPON IN MAKING PURCHASING DECISIONS. THE
DEVELOPMENT, RELEASE, AND TIMING OF ANY FEATURES OR FUNCTIONALITY DESCRIBED FOR ORACLE'S PRODUCTS REMAINS
AT THE SOLE DISCRETION OF ORACLE.
2
5. New Features
● Data dictionary
● Better JSON support
● Faster queries – hash joins, new temporary table, histograms, & CATS
● MySQL Document Store or MySQL & NoSQL together or MySQL without the SQL
● UTF8MB4 – CJK, emojis, all four planes of the Unicode standard
● And much, much more!
5
7. You must upgrade from MySQL 5.7!!
● If you are not running MySQL 5.7 you need to upgrade to 5.7 before upgrading to 8.0
● Must not skip steps
○ 5.5 -> 5.6, 5.6 -> 5.7, 5.7 -> 8.0!
○ See Chapter 2 of the MySQL 8.0 manual
https://dev.mysql.com/doc/refman/8.0/en/installing.html
○ Many changes to the system tables so make sure you run mysql_upgrade after updating
software!!
Note that running mysql_upgrade is now longer needed after 8.0.17 as it runs
automatically! 7
8. Backups!
● Backup up your MySQL instance
○ Data
○ Binaries
○ Configuration files
■ Any localizations you have made
8
9. Backup again!
● Backup up your MySQL instance
○ Data
○ Binaries
○ Configuration files
■ Any localizations you have made
● Paranoia in the preservation of your data is not a bad thing!
9
10. Read the Second Chapter of the MySQL 8.0 Manual!!
● Use the repo for your system located at https://dev.mysql.com/downloads
● Really read the second chapter
10
11. https://mysqlserverteam.com/upgrading-to-mysql-8-0-here-is-what-you-need-to-know/
When the MySQL 8.0 binary is started on the MySQL 5.7 image, it will check for these incompatibilities
and terminate the upgrade process if one or more of these incompatibilities are found in the MySQL 5.7
image. Note that the MySQL 8.0 binary will terminate without having done any changes to the MySQL
5.7 image, so the user can restart MySQL 5.7 and fix the reported issues and then start the upgrade
process again.
11
13. The New Shell - mysqlsh
● Download a copy of the latest software from mysql.com and make sure you get a copy of the new
shell (mysqlsh)
● The new shell has a 5.7 -> 8.0 upgrade checker
○ https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-upgrade.html
○ checkForServerUpgrade (ConnectionData connectionData, Dictionary options)
13
14. Examples
● From the system shell:
○ $mysqlsh -- util checkForServerUpgrade user@localhost:3306 --target-version=8.0.18 --output-
format=JSON --config-path=/etc/mysql/my.cnf
● From the New MySQL Shell
○ mysqlsh> util.checkForServerUpgrade('user@example.com:3306', {"password":"password",
"targetVersion":"8.0.18", "configPath":"C:ProgramDataMySQLMySQL Server 8.0my.ini"})
○ mysqlsh> util.checkForServerUpgrade()
14
16. 20 Checks performed to ease your upgrade!
Output from the upgrade checker:
The MySQL server at example.com:3306, version
5.7.25-enterprise-commercial-advanced - MySQL Enterprise Server - Advanced Edition (Commercial),
will now be checked for compatibility issues for upgrade to MySQL 8.0.18...
1) Usage of old temporal type
No issues found
16
17. 20 Checks performed to ease your upgrade!
2) Usage of db objects with names conflicting with new reserved keywords
Warning: The following objects have names that conflict with new reserved keywords.
Ensure queries sent by your applications use `quotes` when referring to them or they will result in
errors. More information: https://dev.mysql.com/doc/refman/en/keywords.html
dbtest.System - Table name
dbtest.System.JSON_TABLE - Column name
dbtest.System.cube - Column name
https://dev.mysql.com/doc/refman/8.0/en/keywords.html
17
18. Checks performed to ease your upgrade!
3) Usage of utf8mb3 charset
Warning: The following objects use the utf8mb3 character set. It is recommended to convert them to
use utf8mb4 instead, for improved Unicode support.
More information: https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-utf8mb3.html
dbtest.view1.col1 - column's default character set: utf8
https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-conversion.html
18
19. Checks performed to ease your upgrade!
4) Table names in the mysql schema conflicting with new tables in 8.0
No issues found
https://dev.mysql.com/doc/refman/8.0/en/keywords.html
19
20. Checks performed to ease your upgrade!
5) Partitioned tables using engines with non native partitioning
Error: In MySQL 8.0 storage engine is responsible for providing its own partitioning handler, and the MySQL
server no longer provides generic partitioning support. InnoDB and NDB are the only storage engines that
provide a native partitioning handler that is supported in MySQL 8.0. A partitioned table using any other
storage engine must be altered—either to convert it to InnoDB or NDB, or to remove its partitioning—before
upgrading the server, else it cannot be used afterwards.
More information: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-
configuration-changes
dbtest.part1_hash - MyISAM engine does not support native partitioning
https://dev.mysql.com/doc/refman/8.0/en/partitioning-limitations-storage-engines.html
https://mysqlserverteam.com/upgrading-to-mysql-8-0-here-is-what-you-need-to-know/ 20
22. Checks performed to ease your upgrade!
6) Foreign key constraint names longer than 64 characters
No issues found
In MySQL 8.0, tables with foreign key constraint where the constraint name exceeds 64 chars is not
supported in order to adhere to the maximum identifier length of database objects
22
23. Checks performed to ease your upgrade!
7) Usage of obsolete MAXDB sql_mode flag
No issues found
8) Usage of obsolete sql_mode flags
No issues found
9) ENUM/SET column definitions containing elements longer than 255 characters
No issues found
These deprecated compatibility SQL modes have been removed: DB2, MAXDB, MSSQL, MYSQL323, MYSQL40, ORACLE, POSTGRESQL,
NO_FIELD_OPTIONS, NO_KEY_OPTIONS, NO_TABLE_OPTIONS. They can no longer be assigned to the sql_mode system variable or
used as permitted values for the mysqldump --compatible option.
23
24. Checks performed to ease your upgrade!
10) Usage of partitioned tables in shared tablespaces
Error: The following tables have partitions in shared tablespaces. Before upgrading to 8.0 they need
to be moved to file-per-table tablespace. You can do this by running query like
'ALTER TABLE table_name REORGANIZE PARTITION X INTO
(PARTITION X VALUES LESS THAN (30) TABLESPACE=innodb_file_per_table);'
More information: https://dev.mysql.com/doc/refman/8.0/en/mysql-nutshell.html#mysql-nutshell-removals
dbtest.table1 - Partition p0 is in shared tablespace tbsp4
dbtest.table1 - Partition p1 is in shared tablespace tbsp4
24
25. Checks performed to ease your upgrade!
11) Circular directory references in tablespace data file paths
No issues found
12) Usage of removed functions
No issues found
25
26. Checks performed to ease your upgrade!
13) Usage of removed GROUP BY ASC/DESC syntax
Error: The following DB objects use removed GROUP BY ASC/DESC syntax. They need to be altered so that
ASC/DESC keyword is removed from GROUP BY clause and placed in appropriate ORDER BY clause.
More information: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-13.html#mysqld-8-0-13-sql-
syntax
dbtest.view1 - VIEW uses removed GROUP BY DESC syntax
dbtest.func1 - FUNCTION uses removed GROUP BY ASC syntax
Queries that previously relied on GROUP BY sorting may produce results that differ from previous MySQL
versions. To produce a given sort order, provide an ORDER BY clause.
26
27. Checks performed to ease your upgrade!
14) Removed system variables for error logging to the system log configuration
No issues found
15) Removed system variables
Error: Following system variables that were detected as being used will be
removed. Please update your system to not rely on them before the upgrade.
More information: https://dev.mysql.com/doc/refman/8.0/en/added-deprecated-removed.html#optvars-
removed
log_builtin_as_identified_by_password - is set and will be removed
show_compatibility_56 - is set and will be removed
27
28. Checks performed to ease your upgrade!
16) System variables with new default values
Warning: Following system variables that are not defined in your
configuration file will have new default values. Please review if you rely on
their current values and if so define them before performing upgrade.
More information: https://mysqlserverteam.com/new-defaults-in-mysql-8-0/
back_log - default value will change
character_set_server - default value will change from latin1 to utf8mb4
collation_server - default value will change from latin1_swedish_ci to
utf8mb4_0900_ai_ci
event_scheduler - default value will change from OFF to ON
[...]
28
29. Checks performed to ease your upgrade!
17) Schema inconsistencies resulting from file removal or corruption
No issues found
18) Table names containing 'FTS'
No issues found
19) Issues reported by 'check table x for upgrade' command
No issues found
https://dev.mysql.com/doc/refman/8.0/en/innodb-fulltext-index.html#innodb-fulltext-index-docid
29
30. Checks performed to ease your upgrade!
20) New default authentication plugin considerations
Warning: The new default authentication plugin 'caching_sha2_password' offers
more secure password hashing than previously used 'mysql_native_password'
(and consequent improved client connection authentication). However, it also
has compatibility implications that may affect existing MySQL installations.
If your MySQL installation must serve pre-8.0 clients and you encounter
compatibility issues after upgrading, the simplest way to address those
issues is to reconfigure the server to revert to the previous default
authentication plugin (mysql_native_password). For example, use these lines
in the server option file:
[mysqld]
default_authentication_plugin=mysql_native_password 30
31. Checks performed to ease your upgrade!
20 continues
However, the setting should be viewed as temporary, not as a long term or
permanent solution, because it causes new accounts created with the setting
in effect to forego the improved authentication security.
If you are using replication please take time to understand how the
authentication plugin changes may impact you.
More information:
https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-
password-compatibility-issues
https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-
password-replication
31
33. SHA256
● The default/preferred authentication plugin has been changed to ‘caching_sha2_password’ since it
provides more secure password encryption ‘mysql_native_password’ plugin and better performance
than the ‘sha256_password’. This may cause some of the applications to throw errors related to
‘caching_sha2_password’ plugin after upgrade to MySQL 8.0. This maybe due to the fact the
clients/connectors are yet to support ‘caching_sha2_password’ plugin.
https://dev.mysql.com/doc/refman/8.0/en/sha256-pluggable-authentication.html
33
34. GIS has greatly changes from pre-5.7 days
● GIS support has also undergone substantial changes in MySQL 8.0.
https://dev.mysql.com/doc/refman/8.0/en/spatial-analysis-functions.html
34
35. UTF8MB4
● Several of the defaults have been changed in MySQL 8.0.
The most important change in defaults has been the change in the default value of
‘character_set_server’ and ‘character_set_database’ from ‘latin1’ to ‘utf8mb4’.
Also the default value of ‘collation_server’ and ‘collation_database’ has been changed from
‘latin1_swedish_ci’ to ‘utf8mb4_0900_ai_ci’.
Since the defaults have been changed, there is a possibility of noticing a change in the behavior
after upgrading to MySQL
https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-conversion.html
https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-utf8mb4.html
35
36. UNDO Log
● The undo log is moved out of the system tablespace as part of the upgrade and the
innodb_undo_tablespaces is set to a minimum and default value of ‘two’ undo tablespaces.
The system tablespace cannot be used for InnoDb undo log in MySQL 8.0.
This provides flexibility to the user to configure the undo log tablespaces and also truncate the undo
log tablespaces without stopping the server.
https://dev.mysql.com/doc/refman/8.0/en/innodb-undo-tablespaces.html
36
37. Encrypted at rest
● Upgrade from MySQL 5.7 which contains encrypted data files requires an additional step: ALTER
INSTANCE ROTATE INNODB MASTER KEY should be executed to ensure it works well with
replication.
https://dev.mysql.com/doc/refman/8.0/en/alter-instance.html
37
38. Finally – Some other resources to read before upgrading
● https://dev.mysql.com/doc/refman/8.0/en/upgrade-prerequisites.html
● https://mysqlserverteam.com/upgrading-to-mysql-8-0-here-is-what-you-need-to-know/
● https://dev.mysql.com/doc/refman/8.0/en/mysql-nutshell.html
● https://mysqlserverteam.com/inplace-upgrade-from-mysql-5-7-to-mysql-8-0/
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/
● MySQL Install & Repo Forum https://forums.mysql.com/list.php?11
38
Good morning, good afternoon, or good evening, depending on your location. This is the MySQL Best of Both Worlds webinar and I am Dave Stokes. I am a MySQL Community Manager and I will be you guide for the this presentation. Please, if you have anyquestions that pop up after this presentation, do not hesitate to contact and there is a mechanism for you to ask questions during this webinar. Remember that the only bad question is the one that you never get answered.