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

Detailed tutorial on installing Python 3.8.1 on Linux

This example takes the installation of Python 3.8...

Angular Cookie read and write operation code

Angular Cookie read and write operations, the cod...

How to restore single table data using MySQL full database backup data

Preface When backing up the database, a full data...

Whitespace processing in HTML/CSS and how to preserve whitespace in the page

Whitespace rules in HTML In HTML, multiple spaces...

Unicode signature BOM (Byte Order Mark) issue for UTF-8 files

I recently encountered a strange thing when debug...

Detailed explanation of MySQL 5.7.9 shutdown syntax example

mysql-5.7.9 finally provides shutdown syntax: Pre...

Talk about the 8 user instincts behind user experience in design

Editor's note: This article is contributed by...

Background gradient animation effect made by css3

Achieve results Implementation Code html <h1 c...

Detailed explanation of JSONObject usage

JSONObject is just a data structure, which can be...

WeChat applet records user movement trajectory

Table of contents Add Configuration json configur...