zoukankan      html  css  js  c++  java
  • mysql 5.6升级到5.7.22

    下载对应的包

    wget  https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.22-linux-glibc2.12-x86_64.tar

    备份数据库(至少备份mysql)

    innobackupex -uxbackup  -u root -p ocm123  --no-timestamp /data/backup/ 

    手动在备一次
    mv mysql mysql_bak
    建立软连接
    ln -s   /root/mysql-5.7.22-linux-glibc2.12-x86_64   mysql
    查看mysql_upgrade 帮助文档 -s, --upgrade-system-tables Only upgrade the system tables, do not try to upgrade the data.
    /etc/init.d/mysqld start
    mysql_upgrade -s
    /etc/init.d/mysqld restart
    到此升级完成,注意观察error日志

    上面是二进制升级过程,下面演示通过yum方式升级

    检查现在版本

    mysql> select @@version;
    +------------+
    | @@version  |
    +------------+
    | 5.7.22-log |
    +------------+
    1 row in set (0.00 sec)
    
    
    [root@redis02 ~]# rpm -qa|grep mysql-community*
    mysql-community-server-5.7.22-1.el6.x86_64
    mysql-community-libs-5.7.22-1.el6.x86_64
    mysql-community-common-5.7.22-1.el6.x86_64
    mysql-community-client-5.7.22-1.el6.x86_64
    mysql-community-embedded-devel-5.7.22-1.el6.x86_64
    mysql-community-devel-5.7.22-1.el6.x86_64
    mysql-community-test-5.7.22-1.el6.x86_64
    mysql-community-libs-compat-5.7.22-1.el6.x86_64
    mysql-community-embedded-5.7.22-1.el6.x86_64
    

      关闭数据库及更新rpm包

    mysqladmin  -u root -p shutdown
    yum upgrade mysql-community*
    

      启动数据库更新系统字典

    /etc/init.d/mysqld start
    mysql_upgrade -u root -p --upgrade-system-tables
    
    [root@redis02 ~]# mysql_upgrade -u root -p --upgrade-system-tables
    Enter password: 
    The --upgrade-system-tables option was used, databases won't be touched.
    Checking if update is needed.
    Checking server version.
    Running queries to upgrade MySQL server.
    The sys schema is already up to date (version 1.5.1).
    Upgrade process completed successfully.
    Checking if update is needed.
    

      重启数据库观察启动日志

    /etc/init.d/mysqld restart
    

      

  • 相关阅读:
    JAVA List对象与json串互相转换
    git错误提示:fatal: remote origin already exists.
    eclipse中js中ctrl+鼠标点击方法出现 the resource is not on the include path of a javaScript project
    JS根据日期获取这周的周一
    jquery基本操作
    redux+react-redux+示例的快速上手体验
    用 async/await 来处理异步
    Git使用详细教程
    SVN里直接把本地目录纳入管理
    修改npm安装的全局路径和配置环境变量的坑
  • 原文地址:https://www.cnblogs.com/omsql/p/9241366.html
Copyright © 2011-2022 走看看