How to upgrade MySQL 5.6 to 5.7 under Windows

How to upgrade MySQL 5.6 to 5.7 under Windows

Written in front

There are two ways to upgrade MySQL: in-place upgrade and logical upgrade. There is no essential difference between these two upgrade methods. There are just some differences in the processing of data files. In-place upgrades directly copy data files, while logical upgrades process data files through logical export and import, which requires the use of mysqldump.

As we all know, logical upgrades take a long time when the amount of data is large. So today we are going to talk about upgrading in place.

In-place upgrade

1. Close the existing MySQL. Use the cmd window to enter the mysql directory and remove the mysql service.

X:\Ares\bin\mysql5.6\bin>mysqld --remove mysql5.6
Service successfully removed.

2. Download the latest mysql5.7 compressed package.

Download address: https://dev.mysql.com/downloads/mysql/

When you unzip the latest MySQL 5.7 compressed package, you will find that there is no data directory and my.ini file, which is different from the previous version.

這里寫圖片描述

3. Copy the data directory and my.ini file of mysql5.6 to mysql5.7.

Please note that some of the configurations in version 5.6 of my.ini are no longer available in version 5.7.

Make the following changes to the mysql.ini file configuration.

[mysqld]
# Set the installation directory of mysql [modify according to local conditions]
basedir = X:/Ares/bin/mysql
# Set the storage directory for mysql database data [modify according to local conditions]
datadir = X:/Ares/bin/mysql/data
#Set port 3306 port = 3306
# Maximum number of connections allowed max_connections=200
# The default character set used by the server is the 8-bit latin1 character set character-set-server=utf8
# The default storage engine that will be used when creating a new table default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysql]
# Set the default character set of the mysql client to default-character-set=utf8

4. Add the mysql5.7 service to the win service queue and start the mysql service.

Add the mysql5.7 service to the win service queue

X:\Ares\bin\mysql5.7\bin>mysqld --install mysql5.7
Service successfully removed.

Start mysql service

X:\Ares\bin\mysql5.7\bin>net start mysql5.7
mysql5.7 service is starting..
The mysql5.7 service has been started successfully.

5. Upgrade mysql: mysql_upgrade -uroot -p

X:\Ares\bin\mysql5.7\bin>mysql_upgrade -uroot -p123
.......Omit 10,000 words.............

The upgrade speed depends on the size of the data directory.

6. After the upgrade is successful, restart the mysql5.7 service again

X:\Ares\bin\mysql5.7\bin>net stop mysql5.7
The mysql service is stopping.
The mysql service has been stopped successfully.
X:\Ares\bin\mysql5.7\bin>net start mysql5.7
mysql5.7 service is starting..
The mysql5.7 service has been started successfully.

7. The installation and upgrade are complete.

The above is the method I introduced to you to upgrade Mysql5.6 to 5.7 under Win. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • MySQL 5.7.30 Installation and Upgrade Issues Detailed Tutorial
  • Upgrade Docker version of MySQL 5.7 to MySQL 8.0.13, data migration
  • phpstudy2018 Tutorial on Upgrading MySQL 5.5 to 5.7 (with pictures and text)
  • Pitfalls and solutions for upgrading MySQL 5.7.23 in CentOS 7
  • Some pitfalls that developers must pay attention to after upgrading to MySQL 5.7
  • Best Practices for MySQL Upgrades
  • How to upgrade MySQL version to 5.7.17 in phpStudy
  • Detailed tutorial for upgrading MySQL 5.7.17 free installation version on Windows (x86, 64bit)
  • Some "pitfalls" of MySQL database upgrade

<<:  Avoid abusing this to read data in data in Vue

>>:  Teach you a trick to achieve text comparison in Linux

Recommend

Common repair methods for MySQL master-slave replication disconnection

Table of contents 01 Problem Description 02 Solut...

CentOS7 uses rpm to install MySQL 5.7 tutorial diagram

1. Download 4 rpm packages mysql-community-client...

SQL implementation of LeetCode (184. The highest salary in the department)

[LeetCode] 184. Department Highest Salary The Emp...

Linux checkup, understand your Linux status (network IO, disk, CPU, memory)

Table of contents 1. Core commands 2. Common comm...

Two query methods when the MySQL query field type is json

The table structure is as follows: id varchar(32)...

Detailed explanation of samba folder sharing server configuration under centos

1. Introduction Recently I found that there are m...

Implementation example of react project from new creation to deployment

Start a new project This article mainly records t...

Detailed explanation of application scenarios of filters in Vue

filter is generally used to filter certain values...

Basic commands for MySQL database operations

1. Create a database: create data data _name; Two...

Specific use of MySQL segmentation function substring()

There are four main MySQL string interception fun...

How to monitor the running status of docker container shell script

Scenario The company project is deployed in Docke...

Some tips on speeding up the development of WeChat mini-programs

1. Create a page using app.json According to our ...

10 Underused or Misunderstood HTML Tags

Here are 10 HTML tags that are underused or misun...