EffectiveMySQL.com - Performance, Scalability, Site Reliability Managing MySQL Version Upgrades Ronald Bradford http://ronaldbradford.com @RonaldBradford 2015.08 EffectiveMySQL.com - Performance, Scalability, Site Reliability About the Author 16 years with MySQL / 26 years with RDBMS Senior Consultant at MySQL Inc (06-08) Consultant for Oracle Corporation (96-99) Published author of 4 MySQL books Ronald BRADFORD http://ronaldbradford.com/presentations/ EffectiveMySQL.com - Performance, Scalability, Site Reliability OTN TOUR 2015 Uruguay www.uyoug.org.uy Argentina www.aroug.org Chile www.cloug.cl Peru www.peoug.org Latin America Oracle User Groups Community www.laouc.net EffectiveMySQL.com - Performance, Scalability, Site Reliability Operating Systems
15
Embed
Managing MySQL Senior Consultant at MySQL Inc …...2015.08 EffectiveMySQL.com - Performance, Scalability, Site Reliability About the Author 16 years with MySQL / 26 years with RDBMS
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
EffectiveMySQL.com - Performance, Scalability, Site Reliability
Managing MySQL Version Upgrades
Ronald Bradfordhttp://ronaldbradford.com
@RonaldBradford
2015.08
EffectiveMySQL.com - Performance, Scalability, Site Reliability
About the Author
16 years with MySQL / 26 years with RDBMS
Senior Consultant at MySQL Inc (06-08)
Consultant for Oracle Corporation (96-99)
Published author of 4 MySQL books
Ronald BRADFORD
http://ronaldbradford.com/presentations/
EffectiveMySQL.com - Performance, Scalability, Site Reliability
OTN TOUR 2015
Uruguay www.uyoug.org.uy
Argentina www.aroug.org
Chile www.cloug.cl
Peru www.peoug.org
Latin America Oracle User Groups Community www.laouc.net
EffectiveMySQL.com - Performance, Scalability, Site Reliability
Operating Systems
EffectiveMySQL.com - Performance, Scalability, Site Reliability
Operating Systems
In this presentation will only be discussing RHEL/OL/CentOS versions
MySQL is also available on
Ubuntu/Debian
Windows
Solaris
Mac OS X
FreeBSD
SuSE
...
EffectiveMySQL.com - Performance, Scalability, Site Reliability
MySQL versions
MySQL version history
EOL - 3.23, 4.0, 4.1, 5.0, 5.1
GA - 5.5, 5.6
DMR - 5.7
EffectiveMySQL.com - Performance, Scalability, Site Reliability
https://en.wikipedia.org/wiki/MySQL
1994
1996MySQL (.com)
1998
2001v3.23
v4.02003
2004v4.1
v5.02005
Sun (.com)
2008
BEFORE Oracle
1995Innobase
Oracle (.com)
2005
MySQL (.com)
2008v5.1
v5.02005
Sun (.com)
2008
DURING SUN
v5.2
v6.0
X X
4/21/2009v5.4 beta
X
Oracle (.com)4/20/2009Acquisition announcement
Proven Scaling
Our Delta
2006 2009
2008 2011
Now
Oracle (.com)12/2010
v5.53/2013
v5.6
Sun (.com)
Percona Server
Maria DB
2006
2009
4/2011v5.5
4/2009v1.0.3
7/2010v5.1
July 2015
10/13v5.6
4/2009 1/2010
4/12v5.5
11/10v5.2
2/12V5.3
2/10v5.1
3/14v10.0
EffectiveMySQL.com - Performance, Scalability, Site Reliability
installation types
Installation types for RHEL/OL
Distro repo
3rd Party repo
Webtatic, Remi
Oracle repo
tar.gz
SourceEffectiveMySQL.com - Performance, Scalability, Site Reliability
RHEL/OL Installation
EffectiveMySQL.com - Performance, Scalability, Site Reliability
RHEL/OL 6 default ISO
Oracle Linux 6 default iso
mysql-libs-5.1 package
EffectiveMySQL.com - Performance, Scalability, Site Reliability
EffectiveMySQL.com - Performance, Scalability, Site Reliability
Oracle yum repo
Oracle yum repo supports
MySQL 5.5
MySQL 5.6
MySQL 5.7
MySQL workbench/connectors/utilities
EffectiveMySQL.com - Performance, Scalability, Site Reliability
distro conflict
RHEL/OL Distro
mysql-server
Oracle Distro
mysql-community-server
EffectiveMySQL.com - Performance, Scalability, Site Reliability
package names
$ yum info mysql-serverLoaded plugins: securityAvailable PackagesName : mysql-serverArch : x86_64Version : 5.1.73Release : 5.el6_6Size : 8.6 MRepo : public_ol6_latestSummary : The MySQL server and related filesURL : http://www.mysql.comLicense : GPLv2 with exceptionsDescription : MySQL is a multi-user, multi-threaded SQL database server. MySQL is a : client/server implementation consisting of a server daemon (mysqld) : and many different client programs and libraries. This package contains : the MySQL server and some accompanying files and directories.
RHEL/OL Default
RHEL/OL 6MySQL 5.1EOL 2013
EffectiveMySQL.com - Performance, Scalability, Site Reliability
package names
$ yum info mysql-community-server
Available PackagesName : mysql-community-serverArch : x86_64Version : 5.6.25Release : 2.el6Size : 53 MRepo : mysql56-communitySummary : A very fast and reliable SQL database serverURL : http://www.mysql.com/
Oracle Repo
EffectiveMySQL.com - Performance, Scalability, Site Reliability
RHEL/OL Upgrade
EffectiveMySQL.com - Performance, Scalability, Site Reliability
EffectiveMySQL.com - Performance, Scalability, Site Reliability
standard upgrade
yum update is not enough$ tail -20 /var/log/mysqld.log...2015-07-24 17:28:31 31214 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_account_by_event_name' has the wrong structure2015-07-24 17:28:31 31214 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_user_by_event_name' has the wrong structure2015-07-24 17:28:31 31214 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_host_by_event_name' has the wrong structure2015-07-24 17:28:31 31214 [ERROR] Native table 'performance_schema'.'events_statements_summary_global_by_event_name' has the wrong structure2015-07-24 17:28:31 31214 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_digest' has the wrong structure2015-07-24 17:28:31 31214 [ERROR] Native table 'performance_schema'.'users' has the wrong structure2015-07-24 17:28:31 31214 [ERROR] Native table 'performance_schema'.'accounts' has the wrong structure2015-07-24 17:28:31 31214 [ERROR] Native table 'performance_schema'.'hosts' has the wrong structure2015-07-24 17:28:31 31214 [ERROR] Native table 'performance_schema'.'socket_instances' has the wrong structure2015-07-24 17:28:31 31214 [ERROR] Native table 'performance_schema'.'socket_summary_by_instance' has the wrong structure2015-07-24 17:28:31 31214 [ERROR] Native table 'performance_schema'.'socket_summary_by_event_name' has
Always check the error log
EffectiveMySQL.com - Performance, Scalability, Site Reliability
mysql_upgrade
$ sudo mysql_upgradeLooking for 'mysql' as: mysqlLooking for 'mysqlcheck' as: mysqlcheckRunning 'mysqlcheck with default connection argumentsWarning: Using a password on the command line interface can be insecure.Running 'mysqlcheck with default connection argumentsWarning: Using a password on the command line interface can be insecure.mysql.columns_priv OKmysql.db OKmysql.event OKmysql.func OKmysql.general_log OKmysql.help_category OKmysql.help_keyword OKmysql.help_relation OKmysql.help_topic OKmysql.host OKmysql.ndb_binlog_index OKmysql.plugin OKmysql.proc OKmysql.procs_priv OKmysql.proxies_priv OKmysql.servers OKmysql.slow_log OKmysql.tables_priv OK
mysql_upgrade must also be run
on a running instance
EffectiveMySQL.com - Performance, Scalability, Site Reliability
Repo Change
EffectiveMySQL.com - Performance, Scalability, Site Reliability
EffectiveMySQL.com - Performance, Scalability, Site Reliability
reserved words
mysql> CREATE TABLE table(c1 CHAR(1));ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table(c1 CHAR(1))' at line 1
EffectiveMySQL.com - Performance, Scalability, Site Reliability
timestamp defaults
$ tail /var/log/mysqld.log
[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
TIMESTAMP datatype
DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP
EffectiveMySQL.com - Performance, Scalability, Site Reliability
EffectiveMySQL.com - Performance, Scalability, Site Reliability
fulltext
MySQL 5.5 default storage engine changed to InnoDB
CREATE TABLE without ENGINE=MyISAM fails in 5.5
MySQL 5.6 InnoDB now supports FTS
Search results differ between MyISAM and InnoDB
EffectiveMySQL.com - Performance, Scalability, Site Reliability
optimizer
Some queries will have a different QEP
Testing is necessary to validate if query is worse in performance
Some queries are definitely better
EffectiveMySQL.com - Performance, Scalability, Site Reliability
clear text password
$ mysql -uuser -ppasswordWarning: Using a password on the command line interface can be insecure.
mysql> CHANGE MASTER ...;mysql> SHOW WARNINGS\G************************** 1. row *************************** Level: Note Code: 1759Message: Sending passwords in plain text without SSL/TLS is extremely insecure.*************************** 2. row *************************** Level: Note Code: 1760Message: Storing MySQL user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MySQL Manual for more about this issue and possible alternatives.
EffectiveMySQL.com - Performance, Scalability, Site Reliability
Configuration
EffectiveMySQL.com - Performance, Scalability, Site Reliability
new configuration
Upgrade configuration path
Inherit new configuration or keep legacy from prior version?
EffectiveMySQL.com - Performance, Scalability, Site Reliability