1,关闭MysqL服务
2,高版本软件覆盖低版本软件(替换掉basedir)
3,赋予新的高版本软件MysqL权限
4,使用新的软件开启数据库
5,执行MysqL_upgrade升级
实验:
5.6.23升级到5.7.12
1,关闭正在运行的MysqL5.6.23的服务
2,删除低版本的MysqL软件(basedir)
[root@MysqLupgrade MysqL]# rm -rf MysqL/
3,解压高版本的MysqL软件包,覆盖到原来的位置
[root@MysqLupgrade soft]# tar xzvf MysqL-5.7.12-linux-glibc2.5-x86_64.tar.gz -C /data/MysqL/
[root@MysqLupgrade MysqL]# mv MysqL-5.7.12-linux-glibc2.5-x86_64 MysqL
4,赋予权限
[root@MysqLupgrade MysqL]# chown -R MysqL:MysqL MysqL/
5,开启数据库
[root@MysqLupgrade MysqL]# bin/MysqLd_safe --ledir=/data/MysqL/MysqL/bin --user=MysqL &
6,进入数据库,查看当前版本
MysqL> select version();
+-----------+
| version() |
+-----------+
| 5.7.12 |
+-----------+
1 row in set (0.00 sec)
6,MysqL_upgrade升级
[root@MysqLupgrade MysqL]# bin/MysqL_upgrade -udbauser -p123456 -h292.168.56.99 -P3306
MysqL_upgrade: [Warning] Using a password on the command line interface can be insecure.
Checking if update is needed.
Checking server version.
Running queries to upgrade MysqL server.
Checking system database.
MysqL.columns_priv OK
MysqL.db OK
MysqL.engine_cost OK
MysqL.event OK
MysqL.func OK
MysqL.general_log OK
MysqL.gtid_executed OK
MysqL.help_category OK
MysqL.help_keyword OK
MysqL.help_relation OK
MysqL.help_topic OK
MysqL.innodb_index_stats OK
MysqL.innodb_table_stats OK
MysqL.ndb_binlog_index OK
MysqL.plugin OK
MysqL.proc OK
MysqL.procs_priv OK
MysqL.proxies_priv OK
MysqL.server_cost OK
MysqL.servers OK
MysqL.slave_master_info OK
MysqL.slave_relay_log_info OK
MysqL.slave_worker_info OK
MysqL.slow_log OK
MysqL.tables_priv OK
MysqL.time_zone OK
MysqL.time_zone_leap_second OK
MysqL.time_zone_name OK
MysqL.time_zone_transition OK
MysqL.time_zone_transition_type OK
MysqL.user OK
Upgrading the sys schema.
Checking databases.
sys.sys_config OK
Upgrade process completed successfully.
Checking if update is needed.
[root@MysqLupgrade MysqL]#
备注:
升级的时候报错
[root@MysqLupgrade MysqL]# /data/MysqL/MysqL/bin/MysqL_upgrade -udbauser -p123456
Warning: Using a password on the command line interface can be insecure.
Looking for 'MysqL' as: /data/MysqL/MysqL/bin/MysqL
Looking for 'MysqLcheck' as: /data/MysqL/MysqL/bin/MysqLcheck
Error: Failed while fetching Server version! Could be due to unauthorized access.
Fatal error: Upgrade Failed
MysqL -udbauser -p123abc456 -h292.168.56.99 -P3306
测试下这样 是否可以连上,必须要能连上才可以。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。