SlideShare a Scribd company logo
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Upgrading to MySQL 8.0+, a More Automated
Upgrade Experience
Ståle Deraas, Software Development Director
Oracle, MySQL
Oct 2018
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
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
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Agenda
Introduction
A straight forward upgrade to MySQL 8.0
Upgrade to MySQL 8.0 in detail
A better future with MySQL 8.0 ->
1
2
3
4
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Introduction
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Upgrading in General
• Why upgrade the MySQL installation?
– Security concerns
– Performance and Scalability
– New functionality
– Reduce tech debt for the MySQL installation
• Multiple version upgrade is complex (5.6 -> 5.7 -> 8.0)
• Eg. deprecated functionality in 5.7, removed in 8.0
5
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Why do we postpone upgrades?
• Do we have the required knowledge?
• Do we have the required resources?
• Do we have the time?
• Cost for doing the actual work necessary to upgrade
– For DBAs and possibly consultants
• Can we afford it?
– Cost for lost business during the switchover, depending on downtime
6
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Upgrading in General - Biting the Bullet
• At some point upgrade needs to happen!
• DBA input regarding upgrading MySQL
– Reducing risk and cost is key
– Total duration of upgrade should be short
– For customer apps, keep old MySQL behaviour by default, change behavior later
– Want to test new version gradually
– When switching, downtime should be minimal
7
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Upgrade to MySQL 8.0
The straightforward case
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
MySQL upgrade 5.7 -> 8.0, smooth sailing!
9
• Read release notes: Conclusion – No problems
• Run upgrade_checker
me@siv20$ ./mysqlsh root:@localhost:3307 -e "util.checkForServerUpgrade();”
The MySQL server at localhost:3307 will now be checked for compatibility issues for upgrade to
MySQL 8.0...
MySQL version: 5.7.24 - Source distribution
1) Usage of db objects with names conflicting with reserved keywords in 8.0
No issues found
2) Usage of utf8mb3 charset
No issues found
.....
No known compatibility errors or issues for upgrading the target server to MySQL 8 were found.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
MySQL upgrade 5.7 -> 8.0, smooth sailing! Con’t
10
• Backup your data directory, install and start MySQL 8.0
– In-place upgrade
• Run mysql_upgrade
• me@siv20$ ./mysql_upgrade --socket=/me/mysql/mysql.sock --port=3307 --user=root
• Checking if update is needed.
• Checking server version.
• Running queries to upgrade MySQL server.
• Upgrading system table data.
• Checking system database.
• mysql.columns_priv OK
• mysql.component OK
• mysql.db OK
...
• Upgrade process completed successfully.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
MySQL upgrade 5.7 -> 8.0, smooth sailing! Con’t
11
• Restart the server and look at messages in the error log
2018-10-06T09:11:28.167169Z 0 [System] [MY-010116] [Server] /me/mysqld (mysqld 8.0.12) starting as process 27147
2018-10-06T09:11:30.261139Z 0 [System] [MY-010931] [Server] /me/mysqld: ready for connections. Version:
'8.0.12' socket: ’/me/mysql/mysql.sock' port: 3307 Source distribution
• Verify that apps and services are working as expected
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Improvements to upgrade to MySQL 8.0
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Goals for the MySQL upgrade experience
• Upgrade to be faster and with lower risk
– Eliminate legacy issues with metadata
• Transition from legacy metadata handling to transactional data dictionary
• The upgrade process will produce a consistent data dictionary
• Help DBAs upgrading to MySQL 8.0
– Better support preparing for the upgrade
• Added upgrade_checker to the MySQL Shell
– Better support during the upgrade
• Added upgrade checks to MySQL server
• Prohibit legacy issues from entering the 8.0 metadata store
13
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
MySQL Data Dictionary before MySQL 8.0
14
Data Dictionary
Files
FRM TRG OPT
System Tables (mysql.)
user procevents
InnoDB System Tables
MyISAM
File system
InnoDB
SQL
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Transactional Data Dictionary in MySQL 8.0
15
Data Dictionary
InnoDB
SQL
DD TableDD TableDD Table
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Typical upgrade procedure
• Let a slave have the new version, and receive all data
• Test applications on new slave, and possibly adapt applications
• Let slave receive production traffic
• Upgrade remaining slaves
• Finally promote master
16
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
The traditional MySQL upgrade
• Consider standalone ”in-place” upgrade, new SW on existing data image
– Proper backups are assumed
1. Stop old MySQL server
2. Change binaries to new MySQL server version
3. Adjust config, my.cnf of new server version
4. Start new MySQL server
5. Run mysql_upgrade to possibly upgrade system tables and user tables
6. Restart MySQL server
17
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Upgrade to 8.0 in detail and how the
upgrade_checker helps
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
MySQL 8.0 Features
19
• Read release notes https://dev.mysql.com/doc/relnotes/mysql/8.0/en/
and https://dev.mysql.com/doc/refman/8.0/en/upgrading.html
• Read blogs on https://mysqlserverteam.com
• New features in 8.0, and there is a lot of them
– Transactional Data Dictionary, and Atomic DDL
– Geography support
– Roles
– Persistent runtime configuration
– ++++
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
MySQL 8.0 Deprecation/Removals, Samples
– Features removed
• Query Cache, Non-native partitioning
– Options and variables removed
• Log_errors/log_warnings replaced by log_error_verbosity
• Secure_auth system var, --secure-auth client option and MYSQL_SECURE_AUTH from mysql options
• SQL Modes removed
– Account management
• The PASSWORD() function has been removed, using GRANT to create users is no longer supported
– Syntaxes affected
• EXTENDED and PARTITIONS keywords for EXPLAIN removed
• N as a synonym for NULL in SQL removed. Use NULL instead
20
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
MySQL 8.0 Defaults Changes
There are a lot of changes to the defaults in 8.0, see
https://mysqlserverteam.com/new-defaults-in-mysql-8-0/
Some important ones:
– Default characterset and collation to 'utf8mb4' and 'utf8mb4_0900_ai_ci’
– The default/preferred authentication plugin ‘caching_sha2_password’
– innodb_undo_tablespaces changed from 0 to 2
– log_bin has been changed from OFF to ON
– Upgrade from MySQL 5.7: ALTER INSTANCE ROTATE INNODB MASTER KEY
21
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
MySQL 8.0 Defaults Changes
–Especially note, character set and collation defaults changes
– Note that for upgrading SCHEMAs from 5.7 to 8.0, each shema has it’s own specified
default charset and collation, so nothing needs to be done to preserve this
– Rolling upgrade with a 5.7 master
• For new schemas using defaults, you will get the master’s charset and collation on the 8.0 slaves too
• New tables in existing schemas inherit the schemas defaults, so ”no problem”
22
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
MySQL upgrade_checker
– New tool in MySQL 5.7 Shell
– upgrade_checker will check your MySQL 5.7 installation readiness for upgrade
– Clean up legacy issues
• Running the tool on the 5.7 installation, users can make changes when time permits before the
upgrade
– upgrade_checker is in active development and more checks will be added
• Part of MySQL update releases
– NOTE We think it is unlikely that there are installations with all the issues explained
in the following slides
23
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
• Usage of old temporal type
• Conflicting db object names and
reserved keywords
• Usage of utf8mb3 charset
• Reserved tablenames in mysql
schema
• FK names longer than 64 chars
• Usage of obsolete sql_mode
• ENUM/SET column definitions
containing elements longer than
255 characters
• Usage of partitioned tables in
shared tablespaces
• Usage of removed functions
• Usage of removed GROUP BY
ASC/DESC
• Issues reported by ”check table x
for upgrade” command
24
MySQL upgrade_checker
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Issues detected by the upgrade_checker: example 1
• The Transactional Data Dictionary is stored as tables in mysql schema, and
can not conflict with user table names
– Detect with SQL:
SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE LOWER(TABLE_SCHEMA) = 'mysql’ and LOWER(TABLE_NAME) IN ( 'catalogs’,
’character_sets’....);
– ACTION: RENAME tables with conflicting name
25
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Issues detected by the upgrade_checker: example 2
• In MySQL 5.7, several spatial functions available under multiple names
were deprecated. Example PointFromText
– Detect with SQL:
Use INFORMATION_SCHEMA to look at VIEW definitions like e.g. :
select table_name from information_schema.views where view_definition like "%function%”
Do similar for ROUTINE, TRIGGER,EVENT, GC
– ACTION: Use the new function in 8.0 with prefix ’ST_’ or ’MBR’
– ALTER TABLE t_gcol_dep MODIFY g POINT GENERATED ALWAYS AS (ST_POINTFROMTEXT(POINT(10, 10)));
26
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Issues detected by the upgrade_checker: example 3
• Data types like e.g old style decimals, old style TIME/DATETIME etc that
have persisted up until MySQL 5.7 due to the binary upgrade will not be
supported in MySQL 8.0
– Tables using this type can be identified by running CHECK TABLE…FOR UPGRADE or
mysqlcheck with check-upgrade option in MySQL 5.7
– ACTION: fix through REPAIR TABLE and dump/reload for old style varchar/old style
decimal
27
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
When the upgrade_checker runs clean
28
• Backup your data directory, and install new MySQL 8.0 version
• Run mysql_upgrade
• Restart the server and inspect the error log
• Reconnect apps and verify they work as expected
• Attempting upgrade without a clean upgrade_checker run will abort the
upgrade
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
A better future with MySQL 8.0 ->
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Upgrade MySQL 8.0 ->
• How can we continue improving the upgrade?
–We want to reduce time and risk even further
• Bulk of time spent for in-place upgrade of MySQL:
–Harvest metadata for analysis
–Examine all user tables
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Transactional Data Dictionary in MySQL 8.0
31
Data Dictionary
InnoDB
SQL
DD TableDD TableDD Table
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Upgrade MySQL 8.0 ->
• MySQL now stores all metadata in InnoDB (Done)
– Enables fast metadata analysis with SQL-queries
• Added metadata for versioning (Done)
– The new mysqld executable knows which version it is upgrading from
• Improved protection of metadata, good for security reasons (Partly done)
– Enforced metadata integrity
• Remove need for mysql_upgrade client (WIP)
– Move functionality to mysqld proper
– Docker/container friendly
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Upgrade MySQL 8.0 -> the GREAT news
• The traditional MySQL upgrade revisited
1. Stop old MySQL server
2. Change binaries to new MySQL server version
3. Adjust config, my.cnf of new server version
4. Start new MySQL server
• Analyze metadata and automatically upgrade, making upgrade process fast
5. Run mysq_upgrade to possibly upgrade system tables and user tables
• Potentially time consuming
6. Restart MySQL server
• Reduces downtime, container/docker friendly
33
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Summary: Upgrade MySQL 8.0 ->
• Lowers risk
– The upgrade_checker identifies potential issues
• In active development
– Metadata integrity
• Faster upgrade process
– Fast metadata analysis
– Fast metadata upgrade
– Removal of mysql_upgrade
• Simplified upgrade process
– Fewer steps
– Automatic metadata upgrade
34
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Recap: Upgrade to MySQL 8.0
• Prepare your upgrade (release notes, resources)
• DO run the upgrade_checker
– Fix issues until it runs clean
• TEST your applications on MySQL 8.0
• DO your backup
• Upgrade to MySQL 8.0
35
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Try for yourself!
• Downloadable 8.0.13
– http://dev.mysql.com
• Enjoy and give us your feedback!
• Thank you for listening
• http://mysqlserverteam.com
36
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
MySQL Upgrade Resources
• https://dev.mysql.com/doc/refman/8.0/en/upgrading-strategies.html#upgrade-prerequisites
• https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html
• https://mysqlserverteam.com/inplace-upgrade-from-mysql-5-7-to-mysql-8-0/
• https://mysqlserverteam.com/upgrading-to-mysql-8-0-here-is-what-you-need-to-know/
• https://mysqlserverteam.com/mysql-shell-8-0-4-introducing-upgrade-checker-utility/
• https://mysqlserverteam.com/upgrading-to-mysql-8-0-with-spatial-data/
• https://mysqlserverteam.com/whats-new-in-mysql-8-0-generally-available/
• https://mysqlserverteam.com/upgrading-your-mysql-server-farm/

More Related Content

What's hot

MySQL Tech Tour 2015 - 5.7 Security
MySQL Tech Tour 2015 - 5.7 SecurityMySQL Tech Tour 2015 - 5.7 Security
MySQL Tech Tour 2015 - 5.7 Security
Mark Swarbrick
 
MySQL Enterprise Portfolio
MySQL Enterprise PortfolioMySQL Enterprise Portfolio
MySQL Enterprise Portfolio
Abel Flórez
 
MySQL 5.7 Replication News
MySQL 5.7 Replication News MySQL 5.7 Replication News
MySQL 5.7 Replication News
Ted Wennmark
 
MySQL 5.7 - What's new, How to upgrade and Document Store
MySQL 5.7 - What's new, How to upgrade and Document StoreMySQL 5.7 - What's new, How to upgrade and Document Store
MySQL 5.7 - What's new, How to upgrade and Document Store
Abel Flórez
 
MySQL Manchester TT - 5.7 Whats new
MySQL Manchester TT - 5.7 Whats newMySQL Manchester TT - 5.7 Whats new
MySQL Manchester TT - 5.7 Whats new
Mark Swarbrick
 
MySQL The State of the Dolphin - jun15
MySQL The State of the Dolphin - jun15MySQL The State of the Dolphin - jun15
MySQL The State of the Dolphin - jun15
MySQL Brasil
 
MySQL Cluster
MySQL ClusterMySQL Cluster
MySQL Cluster
Abel Flórez
 
MySQL 5.6, news in 5.7 and our HA options
MySQL 5.6, news in 5.7 and our HA optionsMySQL 5.6, news in 5.7 and our HA options
MySQL 5.6, news in 5.7 and our HA options
Ted Wennmark
 
MySQL Intro JSON NoSQL
MySQL Intro JSON NoSQLMySQL Intro JSON NoSQL
MySQL Intro JSON NoSQL
Mark Swarbrick
 
MySQL in oracle_environments(Part 2): MySQL Enterprise Monitor & Oracle Enter...
MySQL in oracle_environments(Part 2): MySQL Enterprise Monitor & Oracle Enter...MySQL in oracle_environments(Part 2): MySQL Enterprise Monitor & Oracle Enter...
MySQL in oracle_environments(Part 2): MySQL Enterprise Monitor & Oracle Enter...
OracleMySQL
 
MySQL Tech Tour 2015 - Alt Intro
MySQL Tech Tour 2015 - Alt IntroMySQL Tech Tour 2015 - Alt Intro
MySQL Tech Tour 2015 - Alt Intro
Mark Swarbrick
 
01 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv101 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv1Ivan Ma
 
OUG Harmony 2012 - Using SQL Plan Baselines for Performance Testing
OUG Harmony 2012 -  Using SQL Plan Baselines for Performance TestingOUG Harmony 2012 -  Using SQL Plan Baselines for Performance Testing
OUG Harmony 2012 - Using SQL Plan Baselines for Performance Testing
Maris Elsins
 
MySQL Cluster
MySQL ClusterMySQL Cluster
MySQL Cluster
Mario Beck
 
MySQL Manchester TT - Security
MySQL Manchester TT  - SecurityMySQL Manchester TT  - Security
MySQL Manchester TT - Security
Mark Swarbrick
 
Mysql security 5.7
Mysql security 5.7 Mysql security 5.7
Mysql security 5.7
Mark Swarbrick
 
Oracle Enterprise Manager Cloud Control 13c for DBAs
Oracle Enterprise Manager Cloud Control 13c for DBAsOracle Enterprise Manager Cloud Control 13c for DBAs
Oracle Enterprise Manager Cloud Control 13c for DBAs
Gokhan Atil
 
MySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & TuneMySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & Tune
Mark Swarbrick
 
What's new in MySQL 5.7, Oracle Virtual Technology Summit, 2016
What's new in MySQL 5.7, Oracle Virtual Technology Summit, 2016What's new in MySQL 5.7, Oracle Virtual Technology Summit, 2016
What's new in MySQL 5.7, Oracle Virtual Technology Summit, 2016Geir Høydalsvik
 
MySQL in Oracle environment : Quick start guide for Oracle DBA (Part 1)
MySQL in Oracle environment : Quick start guide for Oracle DBA (Part 1)MySQL in Oracle environment : Quick start guide for Oracle DBA (Part 1)
MySQL in Oracle environment : Quick start guide for Oracle DBA (Part 1)
OracleMySQL
 

What's hot (20)

MySQL Tech Tour 2015 - 5.7 Security
MySQL Tech Tour 2015 - 5.7 SecurityMySQL Tech Tour 2015 - 5.7 Security
MySQL Tech Tour 2015 - 5.7 Security
 
MySQL Enterprise Portfolio
MySQL Enterprise PortfolioMySQL Enterprise Portfolio
MySQL Enterprise Portfolio
 
MySQL 5.7 Replication News
MySQL 5.7 Replication News MySQL 5.7 Replication News
MySQL 5.7 Replication News
 
MySQL 5.7 - What's new, How to upgrade and Document Store
MySQL 5.7 - What's new, How to upgrade and Document StoreMySQL 5.7 - What's new, How to upgrade and Document Store
MySQL 5.7 - What's new, How to upgrade and Document Store
 
MySQL Manchester TT - 5.7 Whats new
MySQL Manchester TT - 5.7 Whats newMySQL Manchester TT - 5.7 Whats new
MySQL Manchester TT - 5.7 Whats new
 
MySQL The State of the Dolphin - jun15
MySQL The State of the Dolphin - jun15MySQL The State of the Dolphin - jun15
MySQL The State of the Dolphin - jun15
 
MySQL Cluster
MySQL ClusterMySQL Cluster
MySQL Cluster
 
MySQL 5.6, news in 5.7 and our HA options
MySQL 5.6, news in 5.7 and our HA optionsMySQL 5.6, news in 5.7 and our HA options
MySQL 5.6, news in 5.7 and our HA options
 
MySQL Intro JSON NoSQL
MySQL Intro JSON NoSQLMySQL Intro JSON NoSQL
MySQL Intro JSON NoSQL
 
MySQL in oracle_environments(Part 2): MySQL Enterprise Monitor & Oracle Enter...
MySQL in oracle_environments(Part 2): MySQL Enterprise Monitor & Oracle Enter...MySQL in oracle_environments(Part 2): MySQL Enterprise Monitor & Oracle Enter...
MySQL in oracle_environments(Part 2): MySQL Enterprise Monitor & Oracle Enter...
 
MySQL Tech Tour 2015 - Alt Intro
MySQL Tech Tour 2015 - Alt IntroMySQL Tech Tour 2015 - Alt Intro
MySQL Tech Tour 2015 - Alt Intro
 
01 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv101 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv1
 
OUG Harmony 2012 - Using SQL Plan Baselines for Performance Testing
OUG Harmony 2012 -  Using SQL Plan Baselines for Performance TestingOUG Harmony 2012 -  Using SQL Plan Baselines for Performance Testing
OUG Harmony 2012 - Using SQL Plan Baselines for Performance Testing
 
MySQL Cluster
MySQL ClusterMySQL Cluster
MySQL Cluster
 
MySQL Manchester TT - Security
MySQL Manchester TT  - SecurityMySQL Manchester TT  - Security
MySQL Manchester TT - Security
 
Mysql security 5.7
Mysql security 5.7 Mysql security 5.7
Mysql security 5.7
 
Oracle Enterprise Manager Cloud Control 13c for DBAs
Oracle Enterprise Manager Cloud Control 13c for DBAsOracle Enterprise Manager Cloud Control 13c for DBAs
Oracle Enterprise Manager Cloud Control 13c for DBAs
 
MySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & TuneMySQL Tech Tour 2015 - Manage & Tune
MySQL Tech Tour 2015 - Manage & Tune
 
What's new in MySQL 5.7, Oracle Virtual Technology Summit, 2016
What's new in MySQL 5.7, Oracle Virtual Technology Summit, 2016What's new in MySQL 5.7, Oracle Virtual Technology Summit, 2016
What's new in MySQL 5.7, Oracle Virtual Technology Summit, 2016
 
MySQL in Oracle environment : Quick start guide for Oracle DBA (Part 1)
MySQL in Oracle environment : Quick start guide for Oracle DBA (Part 1)MySQL in Oracle environment : Quick start guide for Oracle DBA (Part 1)
MySQL in Oracle environment : Quick start guide for Oracle DBA (Part 1)
 

Similar to Upgrading to my sql 8.0

MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
Olivier DASINI
 
MySQL Manchester TT - Performance Tuning
MySQL Manchester TT  - Performance TuningMySQL Manchester TT  - Performance Tuning
MySQL Manchester TT - Performance Tuning
Mark Swarbrick
 
Pl17: MySQL 8.0: security
Pl17: MySQL 8.0: securityPl17: MySQL 8.0: security
Pl17: MySQL 8.0: security
Georgi Kodinov
 
Automatic upgrade and new error logging in my sql 8.0 oct
Automatic upgrade and new error logging in my sql 8.0 octAutomatic upgrade and new error logging in my sql 8.0 oct
Automatic upgrade and new error logging in my sql 8.0 oct
Ståle Deraas
 
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015 2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
Geir Høydalsvik
 
What's New in MySQL 5.7
What's New in MySQL 5.7What's New in MySQL 5.7
What's New in MySQL 5.7
Olivier DASINI
 
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
GeneXus
 
MySQL Day Paris 2018 - Introduction & The State of the Dolphin
MySQL Day Paris 2018 - Introduction & The State of the DolphinMySQL Day Paris 2018 - Introduction & The State of the Dolphin
MySQL Day Paris 2018 - Introduction & The State of the Dolphin
Olivier DASINI
 
MySQL 5.7 what's new
MySQL 5.7 what's newMySQL 5.7 what's new
MySQL 5.7 what's new
Ricky Setyawan
 
MySQL 8.0 - What's New ?
MySQL 8.0 - What's New ?MySQL 8.0 - What's New ?
MySQL 8.0 - What's New ?
Olivier DASINI
 
6 Tips to MySQL Performance Tuning
6 Tips to MySQL Performance Tuning6 Tips to MySQL Performance Tuning
6 Tips to MySQL Performance Tuning
OracleMySQL
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?
Alkin Tezuysal
 
My sql8 innodb_cluster
My sql8 innodb_clusterMy sql8 innodb_cluster
My sql8 innodb_cluster
Mysql User Camp
 
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7
Morgan Tocker
 
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
Cloud Native Day Tel Aviv
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
Ben Krug
 
MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014Dave Stokes
 
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
Olivier DASINI
 
Using The Mysql Binary Log As A Change Stream
Using The Mysql Binary Log As A Change StreamUsing The Mysql Binary Log As A Change Stream
Using The Mysql Binary Log As A Change Stream
Luís Soares
 
Using MySQL in Automated Testing
Using MySQL in Automated TestingUsing MySQL in Automated Testing
Using MySQL in Automated TestingMorgan Tocker
 

Similar to Upgrading to my sql 8.0 (20)

MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
 
MySQL Manchester TT - Performance Tuning
MySQL Manchester TT  - Performance TuningMySQL Manchester TT  - Performance Tuning
MySQL Manchester TT - Performance Tuning
 
Pl17: MySQL 8.0: security
Pl17: MySQL 8.0: securityPl17: MySQL 8.0: security
Pl17: MySQL 8.0: security
 
Automatic upgrade and new error logging in my sql 8.0 oct
Automatic upgrade and new error logging in my sql 8.0 octAutomatic upgrade and new error logging in my sql 8.0 oct
Automatic upgrade and new error logging in my sql 8.0 oct
 
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015 2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
 
What's New in MySQL 5.7
What's New in MySQL 5.7What's New in MySQL 5.7
What's New in MySQL 5.7
 
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
 
MySQL Day Paris 2018 - Introduction & The State of the Dolphin
MySQL Day Paris 2018 - Introduction & The State of the DolphinMySQL Day Paris 2018 - Introduction & The State of the Dolphin
MySQL Day Paris 2018 - Introduction & The State of the Dolphin
 
MySQL 5.7 what's new
MySQL 5.7 what's newMySQL 5.7 what's new
MySQL 5.7 what's new
 
MySQL 8.0 - What's New ?
MySQL 8.0 - What's New ?MySQL 8.0 - What's New ?
MySQL 8.0 - What's New ?
 
6 Tips to MySQL Performance Tuning
6 Tips to MySQL Performance Tuning6 Tips to MySQL Performance Tuning
6 Tips to MySQL Performance Tuning
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?
 
My sql8 innodb_cluster
My sql8 innodb_clusterMy sql8 innodb_cluster
My sql8 innodb_cluster
 
Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7Upcoming changes in MySQL 5.7
Upcoming changes in MySQL 5.7
 
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014
 
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
 
Using The Mysql Binary Log As A Change Stream
Using The Mysql Binary Log As A Change StreamUsing The Mysql Binary Log As A Change Stream
Using The Mysql Binary Log As A Change Stream
 
Using MySQL in Automated Testing
Using MySQL in Automated TestingUsing MySQL in Automated Testing
Using MySQL in Automated Testing
 

Recently uploaded

LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 

Recently uploaded (20)

LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 

Upgrading to my sql 8.0

  • 1. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Upgrading to MySQL 8.0+, a More Automated Upgrade Experience Ståle Deraas, Software Development Director Oracle, MySQL Oct 2018 Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 2. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement 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
  • 3. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Agenda Introduction A straight forward upgrade to MySQL 8.0 Upgrade to MySQL 8.0 in detail A better future with MySQL 8.0 -> 1 2 3 4
  • 4. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Introduction
  • 5. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Upgrading in General • Why upgrade the MySQL installation? – Security concerns – Performance and Scalability – New functionality – Reduce tech debt for the MySQL installation • Multiple version upgrade is complex (5.6 -> 5.7 -> 8.0) • Eg. deprecated functionality in 5.7, removed in 8.0 5
  • 6. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Why do we postpone upgrades? • Do we have the required knowledge? • Do we have the required resources? • Do we have the time? • Cost for doing the actual work necessary to upgrade – For DBAs and possibly consultants • Can we afford it? – Cost for lost business during the switchover, depending on downtime 6
  • 7. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Upgrading in General - Biting the Bullet • At some point upgrade needs to happen! • DBA input regarding upgrading MySQL – Reducing risk and cost is key – Total duration of upgrade should be short – For customer apps, keep old MySQL behaviour by default, change behavior later – Want to test new version gradually – When switching, downtime should be minimal 7
  • 8. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Upgrade to MySQL 8.0 The straightforward case
  • 9. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | MySQL upgrade 5.7 -> 8.0, smooth sailing! 9 • Read release notes: Conclusion – No problems • Run upgrade_checker me@siv20$ ./mysqlsh root:@localhost:3307 -e "util.checkForServerUpgrade();” The MySQL server at localhost:3307 will now be checked for compatibility issues for upgrade to MySQL 8.0... MySQL version: 5.7.24 - Source distribution 1) Usage of db objects with names conflicting with reserved keywords in 8.0 No issues found 2) Usage of utf8mb3 charset No issues found ..... No known compatibility errors or issues for upgrading the target server to MySQL 8 were found.
  • 10. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | MySQL upgrade 5.7 -> 8.0, smooth sailing! Con’t 10 • Backup your data directory, install and start MySQL 8.0 – In-place upgrade • Run mysql_upgrade • me@siv20$ ./mysql_upgrade --socket=/me/mysql/mysql.sock --port=3307 --user=root • Checking if update is needed. • Checking server version. • Running queries to upgrade MySQL server. • Upgrading system table data. • Checking system database. • mysql.columns_priv OK • mysql.component OK • mysql.db OK ... • Upgrade process completed successfully.
  • 11. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | MySQL upgrade 5.7 -> 8.0, smooth sailing! Con’t 11 • Restart the server and look at messages in the error log 2018-10-06T09:11:28.167169Z 0 [System] [MY-010116] [Server] /me/mysqld (mysqld 8.0.12) starting as process 27147 2018-10-06T09:11:30.261139Z 0 [System] [MY-010931] [Server] /me/mysqld: ready for connections. Version: '8.0.12' socket: ’/me/mysql/mysql.sock' port: 3307 Source distribution • Verify that apps and services are working as expected
  • 12. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Improvements to upgrade to MySQL 8.0
  • 13. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Goals for the MySQL upgrade experience • Upgrade to be faster and with lower risk – Eliminate legacy issues with metadata • Transition from legacy metadata handling to transactional data dictionary • The upgrade process will produce a consistent data dictionary • Help DBAs upgrading to MySQL 8.0 – Better support preparing for the upgrade • Added upgrade_checker to the MySQL Shell – Better support during the upgrade • Added upgrade checks to MySQL server • Prohibit legacy issues from entering the 8.0 metadata store 13
  • 14. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | MySQL Data Dictionary before MySQL 8.0 14 Data Dictionary Files FRM TRG OPT System Tables (mysql.) user procevents InnoDB System Tables MyISAM File system InnoDB SQL
  • 15. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Transactional Data Dictionary in MySQL 8.0 15 Data Dictionary InnoDB SQL DD TableDD TableDD Table
  • 16. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Typical upgrade procedure • Let a slave have the new version, and receive all data • Test applications on new slave, and possibly adapt applications • Let slave receive production traffic • Upgrade remaining slaves • Finally promote master 16
  • 17. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The traditional MySQL upgrade • Consider standalone ”in-place” upgrade, new SW on existing data image – Proper backups are assumed 1. Stop old MySQL server 2. Change binaries to new MySQL server version 3. Adjust config, my.cnf of new server version 4. Start new MySQL server 5. Run mysql_upgrade to possibly upgrade system tables and user tables 6. Restart MySQL server 17
  • 18. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Upgrade to 8.0 in detail and how the upgrade_checker helps
  • 19. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | MySQL 8.0 Features 19 • Read release notes https://dev.mysql.com/doc/relnotes/mysql/8.0/en/ and https://dev.mysql.com/doc/refman/8.0/en/upgrading.html • Read blogs on https://mysqlserverteam.com • New features in 8.0, and there is a lot of them – Transactional Data Dictionary, and Atomic DDL – Geography support – Roles – Persistent runtime configuration – ++++
  • 20. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | MySQL 8.0 Deprecation/Removals, Samples – Features removed • Query Cache, Non-native partitioning – Options and variables removed • Log_errors/log_warnings replaced by log_error_verbosity • Secure_auth system var, --secure-auth client option and MYSQL_SECURE_AUTH from mysql options • SQL Modes removed – Account management • The PASSWORD() function has been removed, using GRANT to create users is no longer supported – Syntaxes affected • EXTENDED and PARTITIONS keywords for EXPLAIN removed • N as a synonym for NULL in SQL removed. Use NULL instead 20
  • 21. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | MySQL 8.0 Defaults Changes There are a lot of changes to the defaults in 8.0, see https://mysqlserverteam.com/new-defaults-in-mysql-8-0/ Some important ones: – Default characterset and collation to 'utf8mb4' and 'utf8mb4_0900_ai_ci’ – The default/preferred authentication plugin ‘caching_sha2_password’ – innodb_undo_tablespaces changed from 0 to 2 – log_bin has been changed from OFF to ON – Upgrade from MySQL 5.7: ALTER INSTANCE ROTATE INNODB MASTER KEY 21
  • 22. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | MySQL 8.0 Defaults Changes –Especially note, character set and collation defaults changes – Note that for upgrading SCHEMAs from 5.7 to 8.0, each shema has it’s own specified default charset and collation, so nothing needs to be done to preserve this – Rolling upgrade with a 5.7 master • For new schemas using defaults, you will get the master’s charset and collation on the 8.0 slaves too • New tables in existing schemas inherit the schemas defaults, so ”no problem” 22
  • 23. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | MySQL upgrade_checker – New tool in MySQL 5.7 Shell – upgrade_checker will check your MySQL 5.7 installation readiness for upgrade – Clean up legacy issues • Running the tool on the 5.7 installation, users can make changes when time permits before the upgrade – upgrade_checker is in active development and more checks will be added • Part of MySQL update releases – NOTE We think it is unlikely that there are installations with all the issues explained in the following slides 23
  • 24. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | • Usage of old temporal type • Conflicting db object names and reserved keywords • Usage of utf8mb3 charset • Reserved tablenames in mysql schema • FK names longer than 64 chars • Usage of obsolete sql_mode • ENUM/SET column definitions containing elements longer than 255 characters • Usage of partitioned tables in shared tablespaces • Usage of removed functions • Usage of removed GROUP BY ASC/DESC • Issues reported by ”check table x for upgrade” command 24 MySQL upgrade_checker
  • 25. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Issues detected by the upgrade_checker: example 1 • The Transactional Data Dictionary is stored as tables in mysql schema, and can not conflict with user table names – Detect with SQL: SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE LOWER(TABLE_SCHEMA) = 'mysql’ and LOWER(TABLE_NAME) IN ( 'catalogs’, ’character_sets’....); – ACTION: RENAME tables with conflicting name 25
  • 26. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Issues detected by the upgrade_checker: example 2 • In MySQL 5.7, several spatial functions available under multiple names were deprecated. Example PointFromText – Detect with SQL: Use INFORMATION_SCHEMA to look at VIEW definitions like e.g. : select table_name from information_schema.views where view_definition like "%function%” Do similar for ROUTINE, TRIGGER,EVENT, GC – ACTION: Use the new function in 8.0 with prefix ’ST_’ or ’MBR’ – ALTER TABLE t_gcol_dep MODIFY g POINT GENERATED ALWAYS AS (ST_POINTFROMTEXT(POINT(10, 10))); 26
  • 27. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Issues detected by the upgrade_checker: example 3 • Data types like e.g old style decimals, old style TIME/DATETIME etc that have persisted up until MySQL 5.7 due to the binary upgrade will not be supported in MySQL 8.0 – Tables using this type can be identified by running CHECK TABLE…FOR UPGRADE or mysqlcheck with check-upgrade option in MySQL 5.7 – ACTION: fix through REPAIR TABLE and dump/reload for old style varchar/old style decimal 27
  • 28. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | When the upgrade_checker runs clean 28 • Backup your data directory, and install new MySQL 8.0 version • Run mysql_upgrade • Restart the server and inspect the error log • Reconnect apps and verify they work as expected • Attempting upgrade without a clean upgrade_checker run will abort the upgrade
  • 29. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | A better future with MySQL 8.0 ->
  • 30. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Upgrade MySQL 8.0 -> • How can we continue improving the upgrade? –We want to reduce time and risk even further • Bulk of time spent for in-place upgrade of MySQL: –Harvest metadata for analysis –Examine all user tables
  • 31. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Transactional Data Dictionary in MySQL 8.0 31 Data Dictionary InnoDB SQL DD TableDD TableDD Table
  • 32. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Upgrade MySQL 8.0 -> • MySQL now stores all metadata in InnoDB (Done) – Enables fast metadata analysis with SQL-queries • Added metadata for versioning (Done) – The new mysqld executable knows which version it is upgrading from • Improved protection of metadata, good for security reasons (Partly done) – Enforced metadata integrity • Remove need for mysql_upgrade client (WIP) – Move functionality to mysqld proper – Docker/container friendly
  • 33. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Upgrade MySQL 8.0 -> the GREAT news • The traditional MySQL upgrade revisited 1. Stop old MySQL server 2. Change binaries to new MySQL server version 3. Adjust config, my.cnf of new server version 4. Start new MySQL server • Analyze metadata and automatically upgrade, making upgrade process fast 5. Run mysq_upgrade to possibly upgrade system tables and user tables • Potentially time consuming 6. Restart MySQL server • Reduces downtime, container/docker friendly 33
  • 34. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Summary: Upgrade MySQL 8.0 -> • Lowers risk – The upgrade_checker identifies potential issues • In active development – Metadata integrity • Faster upgrade process – Fast metadata analysis – Fast metadata upgrade – Removal of mysql_upgrade • Simplified upgrade process – Fewer steps – Automatic metadata upgrade 34
  • 35. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Recap: Upgrade to MySQL 8.0 • Prepare your upgrade (release notes, resources) • DO run the upgrade_checker – Fix issues until it runs clean • TEST your applications on MySQL 8.0 • DO your backup • Upgrade to MySQL 8.0 35
  • 36. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Try for yourself! • Downloadable 8.0.13 – http://dev.mysql.com • Enjoy and give us your feedback! • Thank you for listening • http://mysqlserverteam.com 36
  • 37. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | MySQL Upgrade Resources • https://dev.mysql.com/doc/refman/8.0/en/upgrading-strategies.html#upgrade-prerequisites • https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html • https://mysqlserverteam.com/inplace-upgrade-from-mysql-5-7-to-mysql-8-0/ • https://mysqlserverteam.com/upgrading-to-mysql-8-0-here-is-what-you-need-to-know/ • https://mysqlserverteam.com/mysql-shell-8-0-4-introducing-upgrade-checker-utility/ • https://mysqlserverteam.com/upgrading-to-mysql-8-0-with-spatial-data/ • https://mysqlserverteam.com/whats-new-in-mysql-8-0-generally-available/ • https://mysqlserverteam.com/upgrading-your-mysql-server-farm/