centos升級MySQL資料庫5.6.39

來源:互聯網
上載者:User

標籤:升級

MySQL資料庫升級3.6.39

準備工作:
1.建立目錄(把升級檔案放在此目錄中)
[[email protected] /]# mkdir /mysqlbak
[[email protected] /]#
2.上傳升級的資料庫版本:
.https://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-5.6.39-1.el7.x86_64.rpm-bundle.tar

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>

centos升級MySQL資料庫5.6.39

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.