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 (20)

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

Similar to Upgrading to my sql 8.0 (20)

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

Recently uploaded (20)

PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PDF
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PPTX
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
Simplify React app login with asgardeo-sdk
vaibhav289687
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Simplify React app login with asgardeo-sdk
vaibhav289687
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Ad

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/