MySQL数据库升级3.6.39
准备工作:
1.新建目录(把升级文件放在此目录中)
[root@localhost /]# mkdir /mysqlbak
[root@localhost /]#
2.上传升级的数据库版本:
.https://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-5.6.39-1.el7.x86_64.rpm-bundle.tar
3.解压
[root@localhost 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
备份数据库
注:升级数据库理论是不影响数据的,安全起见备份数据库
[root@localhost /]# mysqldump -uroot -P 3306 -p -A > /mysqlbak/dabatases.sql
Enter password:
You have new mail in /var/spool/mail/root
[root@localhost /]#
停止数据库
[root@localhost mysqlbak]# service crond stop
Redirecting to /bin/systemctl stop crond.service
You have new mail in /var/spool/mail/root
[root@localhost mysqlbak]# service mysql stop
Shutting down MySQL..................... SUCCESS!
[root@localhost mysqlbak]# netstat -lntup | grep 3306
[root@localhost mysqlbak]#
删除旧版本MySQL包文件
[root@localhost mysqlbak]# yum remove MySQL-share MySQL-client MySQL-devel MySQL-server MySQL-shared
安装新的MySQL包文件
[root@localhost 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> Preparing... ################################# [100%]
Updating / installing...
1:MySQL-client-5.6.39-1.el7 ################################# [100%]
[root@localhost 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> Preparing... ################################# [100%]
Updating / installing...
1:MySQL-devel-5.6.39-1.el7 ################################# [100%]
[root@localhost 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> Preparing... ################################# [100%]
Updating / installing...
1:MySQL-embedded-5.6.39-1.el7 ################################# [100%]
[root@localhost 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> Preparing... ################################# [100%]
Updating / installing...
1:MySQL-shared-5.6.39-1.el7 ################################# [100%]
[root@localhost 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> Preparing... ################################# [100%]
Updating / installing...
1:MySQL-shared-compat-5.6.39-1.el7 ################################# [100%]
[root@localhost 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> Preparing... ################################# [100%]
Updating / installing...
1:MySQL-test-5.6.39-1.el7 ################################# [100%]
[root@localhost 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> Preparing... ################################# [100%]
Updating / installing...
1:MySQL-server-5.6.39-1.el7 ################################# [100%]
登陆升级后MySQL
[root@localhost hy]# /etc/init.d/mysql start
Starting MySQL....... SUCCESS!
[root@localhost 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> 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 +--------------------+
mysqlperformance_schematest +--------------------+
7 rows in set (0.05 sec)
mysql>select version();
+-----------+
| version() |
+-----------+
| 5.6.39 |
+-----------+
1 row in set (0.08 sec)
mysql>
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com