升级方法汇总

方法一、INPLACE就地升级

在一台服务器上,原版本升级到新版本。
风险较大。
除非是主从环境。
升级过程
a. 安装新版本软件
b. 关闭原数据库业务(挂维护页) innodb_fast_shutdown=0
备份原数据库数据(冷备)
c. 使用新版本软件 “挂” 旧版本数据启动(--skip-grant-tables ,--skip-networking)
d. 升级: 只是升级系统表。升级时间和数据量无关的。
e. 正常重启数据库。
f. 验证各项功能是否正常。
g. 业务恢复。
建议: inpalce升级最好是主从环境,先从库再主库。

方法二、主从

方法三、备份

inplace升级注意事项
Upgrade is only supported between General Availability
(GA) releases.
Upgrade from MySQL 5.6 to 5.7 is supported. Upgrading to
the latest release is recommended before upgrading to the
next version. For example, upgrade to the latest MySQL 5.6
release before upgrading to MySQL 5.7.
Upgrade that skips versions is not supported. For example,
upgrading directly from MySQL 5.5 to 5.7 is not supported.
Upgrade within a release series is supported. For example,
upgrading from MySQL 5.7.x to 5.7.y is supported. Skipping
a release is also supported. For example, upgrading from
MySQL 5.7.x to 5.7.z is supported.
a. 支持GA版本之间升级
b. 5.6--> 5.7 ,先将5.6升级至最新版,再升级到5.7
c. 5.5 ---> 5.7 ,先将5.5 升级至最新,再5.5---> 5.6最新,再5.6--->5.7 最新
d. 回退方案要提前考虑好,最好升级前要备份(特别是往8.0版本升级)。
e. 降低停机时间(停业务的时间),在业务不繁忙期间升级,做好足够的预演。
posted @ 2025-06-21 20:07  屠魔的少年  阅读(48)  评论(0)    收藏  举报