mysql5.6 Upgrade 5.7

Source: Internet
Author: User

Two ways to upgrade:

In-place Upgrade: In-place upgrade method, upgrade with existing DataDir directory.

Logical Upgrade: Logical upgrade method, using Mysqldump Export import for upgrade.

However, generally in the production environment, is the use of new new from the library to complete the upgrade, that is, the old version of the main library, from the library target version. So you just need to stop the machine when you switch.

1. Package Preparation:

Download mysql5.7 binary Package file

TAR-ZXVF mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz-c/usr/local/mysql5.7

Chown-r mysql:mysql/usr/local/mysql5.7

2, stop the MySQL service (still using the 5.6 version of the program to stop service)

Mysql-u root-p--execute= "set GLOBAL innodb_fast_shutdown=0"-This parameter must be set.

Mysqladmin--defaults-file=/etc/my.cnf shutdown

3. Backup Data Directory

Copy DataDir Old_datadir

4. Backing up and modifying configuration files

Backup: Copy/etc/my.cnf/etc/my.cnf.bak

Basedir Directory modified to:/usr/local/mysql5.7

Disable Gtid:gtid_mode=off Enforce_gtid_consistency=on

If a third-party audit (such as Percona's audit plugin) is used in version 5.6, the relevant audit parameters in MY.CNF need to be commented out.

##********** Audit *************

#plugin-load=audit_log.so

#audit_log_buffer_size =4194304

#audit_log_file =/data/mysql/mysql3306/auditlog/audit.log

#audit_log_format =new

#audit_log_policy =all

#audit_log_rotate_on_size =1g

#audit_log_rotations =10

#audit_log_strategy =asynchronous

5, manual use Mysqld way Pull Up Database (new version of Mysqld:/usr/local/mysql5.7/bin/mysqld)

/usr/local/mysql5.7/bin/mysqld--defaults-file=/etc/my.cnf Start

6. Upgrading the Digital Dictionary

/usr/local/mysql5.7/bin/mysql_upgrade-uroot-pxxxx

No error is the upgrade success.

7. Restart the database

/usr/local/mysql5.7/bin/mysqladmin--defaults-file=/etc/my.cnf-uroot-pxxxx shutdown

/usr/local/mysql5.7/bin/mysqld--DEFAULTS-FILE=/ETC/MY.CNF &

8. Confirm the success of the upgrade (the SYS library is added)

[Email Protected]:mysql3306.sock 10:48: [(None)]>select version ();

+------------+

| Version () |

+------------+

| 5.7.16-log |

+------------+

1 row in Set (0.00 sec)

[Email Protected]:mysql3306.sock 10:49: [(none)]>show databases;

+---------------------+

| Database |

+---------------------+

| Information_schema |

| MySQL |

| Performance_schema |

| Plum_approve |

| Plum_call_center |

| Plum_credit |

| PLUM_CSM |

| plum_device_content |

| Plum_employee |

| Plum_employee_new |

| Plum_finance |

| Plum_message_center |

| Plum_pay |

| plum_userproduct |

| sys |

| Test |

+---------------------+

Rows in Set (0.00 sec)


This article is from the "thick Product Thin Hair" blog, please make sure to keep this source http://1057212.blog.51cto.com/1047212/1891785

mysql5.6 Upgrade 5.7

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.