Skip to content
WONGCW 網誌
  • 首頁
  • 論壇
  • 微博
  • 壁紙下載
  • 免費圖床
  • 視頻下載
  • 聊天室
  • SEO工具
  • 支援中心
  • 表格製作
  • More
    • 在線名片
    • 網頁搜索
    • 天氣預報
    • 二維碼生成器
    • WordPress 插件及主題下載
  • Search Icon

WONGCW 網誌

記錄生活經驗與點滴

How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.0/10.1/10.2 on Linux

How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.0/10.1/10.2 on Linux

2018-08-01 Comments 0 Comment

Table of contents

  • For Ubuntu 12.04, 14.04 and Debian 7
  • For CentOS 6
  • For CentOS 7
  • For CloudLinux
  • For Debian 8

This article provides instructions about how to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.0/10.1/10.2 on Linux.

The instructions for upgrading MySQL from 5.1 to 5.5 on Linux see in the KB article:

  • How to upgrade MySQL from 5.1 to 5.5 on Linux?

Warning: Direct upgrade from MySQL 5.1 to MySQL 5.6/5.7 will damage tables.
MariaDB 10.2 is not fully supported by Plesk.

Note: Upgrade can be performed in a command-line interface with the instructions below at your own risk. This task is supposed to be performed by a system administrator.

Note: MySQL will not be upgraded in case it installed from webtatic repository:

# rpm -qa | grep -i mysql
mysql55w-server-5.5.57-1.w6.x86_64

First of all, connect to the server via SSH.

For Ubuntu 12.04 and 14.04, Debian 7:

Ubuntu 14.04 is shipped with MySQL 5.5 by default.

    1. Create a full server backup and a server snapshot.
    2. Create a backup of /etc/mysql/my.cnf:

      # cp /etc/mysql/my.cnf{,_original}

    3. Add the MySQL APT Repository:
      • Go to the download page for the MySQL APT repository at http://dev.mysql.com/downloads/repo/apt/.
      • Select and download a release package for your platform:

        # wget https://dev.mysql.com/get/mysql-apt-config_0.8.9-1_all.deb

      • Install the downloaded release package:

        # dpkg -i mysql-apt-config_0.8.9-1_all.deb

        During the installation of the package, you will be asked to choose the versions of the MySQL server and other components that you want to install. If you are not sure which version to choose, do not change the default options selected for you. You can also choose noneif you do not want a particular component to be installed. After making the choices for all components, choose Apply to finish the configuration and installation of the release package.

      • Update package information from the MySQL APT repository:

        # apt-get update

    4. Upgrade MySQL:

      # apt-get install mysql-server

      Agree when prompted to update /etc/mysql/my.cnf.

    5. Make sure that mysql-community-libs-compat package is installed. Install if it is missing.
    6. Upgrade MySQL databases:

      # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin

    7. Restart MySQL server

      # service mysql restart

    8. In Plesk go to Tools & Settings > Server Components and click Refresh.

More information available in MySQL documentation at http://dev.mysql.com/.

For CentOS 6:

      1. Stop the MySQL service:

        # service mysqld stop

      2. Create a backup of databases:

        # cp -a /var/lib/mysql /var/lib/mysql_backup

      3. Disable Atomic repository, if it is enabled:

        # vi /etc/yum.repos.d/atomic.repo
        enabled = 0

      4. Install the MySQL-community repository:

        # yum install http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm

      5. Select a MySQL version:

        # vi /etc/yum.repos.d/mysql-community.repo
        [mysql56-community]
        enabled=0
        [mysql57-community]
        enabled=1

      6. Install MySQL packages:

        # yum update mysql

        If update of mysql package ends with Nothing to do message, make sure that mysql* packages are not added to excludes in yum.conffile and remove it if it is in the list:

        # cat /etc/yum.conf | grep exclude
        exclude=php-common php-cli php mysql* httpd* mod_ssl*

      7. Type y if this message appears:

        warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
        Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
        Importing GPG key 0x5072E1F5:
        Userid : MySQL Release Engineering <mysql-build@oss.oracle.com>
        Package: mysql57-community-release-el6-7.noarch (@/mysql57-community-release-el6-7.noarch)
        From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
        Is this ok [y/N]:

      8. Start the MySQL service:

        # service mysqld start

        If the service does not start, check the following article: MySQL fails to start: mysql.user table is damaged.

      9. Upgrade MySQL databases:

        # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin

      10. Restart mysql service:

        # service mysqld restart

For CentOS 7:

CentOS 7 is shipped with MariaDB. MariaDB 10.x version is a drop-in replacement for MySQL 5.5-5.7.

      1. Create a backup of all databases with the following command:

        # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin –all-databases –routines –triggers > /tmp/all-databases.sql

      2. Stop the MariaDB service:

        # service mariadb stop

      3. Remove additional packages like mariadb-bench:

        # rpm -e mariadb-bench

      4. Copy a databases directory in a separate folder like this (for backup purposes also):

        # cp -a /var/lib/mysql/ /var/lib/mysql_backup

      5. Configure MariaDB repository: open the Setting MariaDB repositories page, select OS distro, release and MariaDB version to see the configuration that should be added to /etc/yum.repos.d/MariaDB.repo file. Example for MariaDB10.1:

        [mariadb]
        name = MariaDB
        baseurl = http://yum.mariadb.org/10.1/centos7-amd64
        gpgkey = https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
        gpgcheck = 1

      6. Perform an upgrade with:

        # yum install mariadb

      7. Start the MariaDB service:

        # service mariadb start

      8. Upgrade MySQL databases:

        # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin

      9. Restart mysql service:

        # service mariadb restart

      10. Execute this command to update the package version inside Plesk:

        # plesk sbin packagemng -sdf

        Note: After an upgrade to 10.1 version, there may appear ‘mysql’ init script. It can be removed:

        # rm /etc/init.d/mysql
        # systemctl daemon-reload

 

For CloudLinux

      1. Create a backup of all databases with the following command:

        # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin –all-databases –routines –triggers > /tmp/all-databases.sql

      2. Stop the MySQL service:

        # service mysql stop

      3. Copy a databases directory in a separate folder like this (for backup purposes also):

        # cp -a /var/lib/mysql/ /var/lib/mysql_backup

      4. Start the MySQL service:

        # service mysql start

      5. Select MariaDB version to install:

        # /usr/share/lve/dbgovernor/db-select-mysql –mysql-version=mariadbXX

        Note: mariadbXX should be substituted with one of the following:
        mariadb100 for MariaDB v10.0
        mariadb101 for MariaDB v10.1

      6. Install selected previously MariaDB engine:

        # /usr/share/lve/dbgovernor/mysqlgovernor.py –install

        Warning: CloudLinux do not recommend to downgrade from MySQL v5.6, MariaDB 10.x

      7. Execute this command to update the package version inside Plesk:

        # plesk sbin packagemng -sdf

For Debian 8

Debian 8 is basically shipped with MariaDB. MariaDB 10.x version is a drop-in replacement for MySQL 5.5/5.6/5.7

Backup all existing databases using the KB article How to backup/restore a Plesk database dump? and follow instructions on MariaDB site to update it:

https://mariadb.com/kb/en/mariadb/installing-mariadb-deb-files/

Execute this command to update package version inside Plesk:

# plesk sbin packagemng -sdf

分享此文:

  • 分享到 Twitter(在新視窗中開啟)
  • 按一下以分享至 Facebook(在新視窗中開啟)
  • 分享到 WhatsApp(在新視窗中開啟)
  • 按一下以分享到 Telegram(在新視窗中開啟)
  • 分享到 Pinterest(在新視窗中開啟)
  • 分享到 Reddit(在新視窗中開啟)
  • 按一下即可分享至 Skype(在新視窗中開啟)
  • 按一下即可以電子郵件傳送連結給朋友(在新視窗中開啟)
  • 點這裡列印(在新視窗中開啟)

相關


教學資源

Post navigation

PREVIOUS
解决Plesk面板Nginx不能自动启动的问题
NEXT
Adding the MariaDB YUM repository

發表迴響 取消回覆

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料。

More results...

Generic filters
Exact matches only
Search in title
Search in content
Search in excerpt
Filter by 分類
網站公告
Featured
限時免費
ESET NOD32
WINDOWS 10 &11 INSIDER PREVIEW
Windows 軟件下載
系統軟件
辦公軟件
圖像處理
影音媒體
網絡軟件
應用軟件
Mac 軟件下載
安卓軟件下載
網絡資訊
Mac資訊
Linux資訊
VPS資訊
NASA資訊
金融資訊
WhatsApp Stickers教學
WordPress資訊
WeChat資訊
PHP資訊
Plesk資訊
TensorFlow
教學資源
開源程序
網頁工具
SEO工具
醫療健康
旅遊及消閒
其他資訊
Content from
Content to
2018 年 8 月
一 二 三 四 五 六 日
 12345
6789101112
13141516171819
20212223242526
2728293031  
« 7 月   9 月 »

分類

  • 網站公告
  • 限時免費
  • ESET NOD32
  • WINDOWS 10 &11 INSIDER PREVIEW
  • Windows 軟件下載
  • 系統軟件
  • 辦公軟件
  • 圖像處理
  • 影音媒體
  • 網絡軟件
  • 應用軟件
  • Mac 軟件下載
  • 安卓軟件下載
  • 網絡資訊
  • Mac資訊
  • Linux資訊
  • VPS資訊
  • NASA資訊
  • WhatsApp Stickers教學
  • WordPress資訊
  • WeChat資訊
  • PHP資訊
  • Plesk資訊
  • TensorFlow
  • 教學資源
  • 開源程序
  • 網頁工具
  • SEO工具
  • 醫療健康
  • 旅遊及消閒
  • 其他資訊

彙整

近期文章

  • 日本芯片公司Rapidus計劃攜手IBM 在2025年前生產2納米製程的原型產品 2023-01-27
  • 英特爾四季報及指引大幅遜於預期盤後股價大跌近9% 2023-01-27
  • 紐約市將要求Uber和Lyft在2030年前實現100%的電動化 2023-01-27
  • 索尼推出兩款高音質隨身聽NW-ZX707與NW-A306 增強音質和電池續航 2023-01-27
  • 新研發的肽噴霧劑可以在不使用抗生素的情況下殺滅傷口中的細菌 2023-01-27
  • 面向植物的新發現可能會帶來更多對蜜蜂友好的殺蟲劑 2023-01-27
  • 不是對所有人都安全:科學家識別綠茶提取物對特定人群的隱藏風險 2023-01-27
  • 行星防禦:了解碎石堆小行星的特性可能有助於人們在未來拯救地球 2023-01-27
  • 微軟並不打算中止Windows 10安裝盤的下載儘管不再售賣許可證 2023-01-27
  • 蘋果自行設計的Wi-Fi芯片開發工作已經“暫停了一段時間” 2023-01-27

熱門文章與頁面︰

  • ESET NOD32 LICENSE KEY (UPDATED 2023-01-17)
  • DP vs HDMI 誰才是遊戲玩家最佳選擇?
  • 打車叫到特斯拉不會開門很尷尬?官方介紹開關門方法
  • Explorer Patcher:讓Windows 11恢復Windows 10的行為特徵
  • 天翼網盤免登陸高速下載,直鏈解析不限速
  • 盜版Windows 7還能免費升級Windows 10嗎?
  • Autodesk AutoCAD 2021 正式版註冊版-簡體/繁體中文/英文版
  • Android 13開始測試了為啥越優化越平庸?
  • CCleaner全家桶激活密鑰
  • PS5實際上擁有網頁瀏覽器但玩家無法隨意訪問

投遞稿件

歡迎各界人士投遞稿件到admin@wongcw.com

請提供以下資料:

1.你的名字

2.你的電郵

3.分類目錄

4.文章標題

5.文章摘要

6.文章內容

7.文章來源

 

聯繫我們

查詢,投稿,商務合作:
​admin@wongcw.com
​技術支援:
​support@wongcw.com
​客户服務:
​cs@wongcw.com

QQ群:833641851

快帆

MALUS

極度掃描

DMCA.com Protection Status

WONGCW 網誌

  • 免責聲明
  • 捐助我們
  • ThemeNcode PDF Viewer
  • ThemeNcode PDF Viewer SC
  • Events

服務器提供

本站使用之服務器由ikoula提供。

聯繫我們

查詢,投稿,商務合作:
​admin@wongcw.com
​技術支援:
​support@wongcw.com
​客户服務:
​cs@wongcw.com

QQ群:833641851

© 2023   All Rights Reserved.
X