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

Solution to using html2canvas to process Dom elements with Baidu map into images

Problem 1: Baidu Map uses tiled images (the map i...

VM VirtualBox virtual machine mount shared folder

One environment Install VMware Tools on CentOS 7 ...

Script to quickly list all host names (computer names) in the LAN under Linux

Recently, I have a need to list all host names in...

Which scenarios in JavaScript cannot use arrow functions

Table of contents 1. Define object methods 2. Def...

How to handle the tcp_mark_head_lost error reported by the Linux system

Problem Description Recently, a host reported the...

Detailed example of MySQL joint table update data

1.MySQL UPDATE JOIN syntax In MySQL, you can use ...

Mini Program to implement Token generation and verification

Table of contents process Demo Mini Program Backe...

How to deploy Go web applications using Docker

Table of contents Why do we need Docker? Docker d...

Django2.* + Mysql5.7 development environment integration tutorial diagram

environment: MAC_OS 10.12 Python 3.6 mysql 5.7.25...

How to configure whitelist access in mysql

Steps to configure whitelist access in mysql 1. L...

uni-app implements NFC reading function

This article shares the specific code of uni-app ...

Creating private members in JavaScript

Table of contents 1. Use closures 2. Use ES6 clas...