centos如何升级mysql数据库_centos升级MySQL数据库5.6.39

标签:升级MySQL数据库升级3.6.39

3.解压

[[email protected] mysqlbak]# tar vxf MySQL-5.6.39-1.el7.x86_64.rpm-bundle.tar

MySQL-shared-compat-5.6.39-1.el7.x86_64.rpm

MySQL-client-5.6.39-1.el7.x86_64.rpm

MySQL-devel-5.6.39-1.el7.x86_64.rpm

MySQL-server-5.6.39-1.el7.x86_64.rpm

MySQL-shared-5.6.39-1.el7.x86_64.rpm

MySQL-test-5.6.39-1.el7.x86_64.rpm

MySQL-embedded-5.6.39-1.el7.x86_64.rpm

备份数据库

注:升级数据库理论是不影响数据的,安全起见备份数据库

[[email protected] /]# mysqldump -uroot -P 3306 -p -A > /mysqlbak/dabatases.sql

Enter password:

You have new mail in /var/spool/mail/root

[[email protected] /]#

停止数据库

[[email protected] mysqlbak]# service crond stop

Redirecting to /bin/systemctl stop crond.service

You have new mail in /var/spool/mail/root

[[email protected] mysqlbak]# service mysql stop

Shutting down MySQL..................... SUCCESS!

[[email protected] mysqlbak]# netstat -lntup | grep 3306

[[email protected] mysqlbak]#

删除旧版本MySQL包文件

[[email protected] mysqlbak]# yum remove MySQL-share MySQL-client MySQL-devel MySQL-server MySQL-shared

安装新的MySQL包文件

[[email protected] mysqlbak]# rpm -ivh MySQL-client-5.6.39-1.el7.x86_64.rpm

warning: MySQL-client-5.6.39-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing... ################################# [100%]

Updating / installing...

1:MySQL-client-5.6.39-1.el7 ################################# [100%]

[[email protected] mysqlbak]# rpm -ivh MySQL-devel-5.6.39-1.el7.x86_64.rpm

warning: MySQL-devel-5.6.39-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing... ################################# [100%]

Updating / installing...

1:MySQL-devel-5.6.39-1.el7 ################################# [100%]

[[email protected] mysqlbak]# rpm -ivh MySQL-embedded-5.6.39-1.el7.x86_64.rpm

warning: MySQL-embedded-5.6.39-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing... ################################# [100%]

Updating / installing...

1:MySQL-embedded-5.6.39-1.el7 ################################# [100%]

[[email protected] mysqlbak]# rpm -ivh MySQL-shared-5.6.39-1.el7.x86_64.rpm

warning: MySQL-shared-5.6.39-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing... ################################# [100%]

Updating / installing...

1:MySQL-shared-5.6.39-1.el7 ################################# [100%]

[[email protected] mysqlbak]# rpm -ivh MySQL-shared-compat-5.6.39-1.el7.x86_64.rpm

warning: MySQL-shared-compat-5.6.39-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing... ################################# [100%]

Updating / installing...

1:MySQL-shared-compat-5.6.39-1.el7 ################################# [100%]

[[email protected] mysqlbak]# rpm -ivh MySQL-test-5.6.39-1.el7.x86_64.rpm

warning: MySQL-test-5.6.39-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing... ################################# [100%]

Updating / installing...

1:MySQL-test-5.6.39-1.el7 ################################# [100%]

[[email protected] mysqlbak]# rpm -ivh MySQL-server-5.6.39-1.el7.x86_64.rpm

warning: MySQL-server-5.6.39-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing... ################################# [100%]

Updating / installing...

1:MySQL-server-5.6.39-1.el7 ################################# [100%]

登陆升级后MySQL

[[email protected] hy]# /etc/init.d/mysql start

Starting MySQL....... SUCCESS!

[[email protected] hy]# mysql -uroot -pBjqdsc402

Warning: Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 8

Server version: 5.6.39 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> show databases;

+--------------------+

Database

+--------------------+

mysql

performance_schema

test

+--------------------+

7 rows in set (0.05 sec)

mysql>select version();

+-----------+

| version() |

+-----------+

| 5.6.39 |

+-----------+

1 row in set (0.08 sec)

mysql>

标签:升级

原文:http://blog.51cto.com/891023/2093071

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值