• 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
    

      

  • 相关阅读:
    [转载].net 访问oracle的总结
    .net平台新语言——Boo 试用
    抛弃ConfigurationManager , 实现面向对象读写配置文件
    延长或控制Session的有效期的方法总结
    jQuery Validation:让验证变得如此容易
    单进程资源共享
    .net快速创建PDF文档 by c#
    百度之星程序设计大赛初赛题4低频词过滤
    Google Talk
    百度之星,我的比赛结束了:)
  • 原文地址:https://www.cnblogs.com/omsql/p/9241366.html
Copyright © 2020-2023  润新知