Home  >  Article  >  Database  >  Share how to upgrade Mysql5.6 to 5.7 under Win

Share how to upgrade Mysql5.6 to 5.7 under Win

黄舟
黄舟Original
2017-04-15 09:31:551753browse

MySQL has two upgrade methods: in-place upgrade and logical upgrade. There is essentially no difference between these two upgrade methods. This article will give you a detailed introduction to the method of upgrading Mysql5.6 to 5.7 under Win. Friends who need it can refer to it

Written in front

MySQL upgrade methods are divided into two types: in-place upgrade and logical upgrade. There is essentially no difference between these two upgrade methods. They only have some differences in the processing of data files. The data file is copied directly, and the logical upgrade method of processing the data file is through logical export and import, which requires the use of mysqldump

Everyone understands that this method is less effective in data volume comparison. It takes a long time in large cases, so today we will talk about in-place upgrade

1. Close the existing mysql. cmd window, go to 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


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


#3. Replace the previous version. Copy the data directory and my.ini file of mysql5.6 to mysql5.7.

Note here: some configurations of version 5.6 in my.ini are no longer available under version 5.7. Share how to upgrade Mysql5.6 to 5.7 under Win

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

[mysqld]
# 设置mysql的安装目录[根据本地情况进行修改]
basedir = X:/Ares/bin/mysql
# 设置mysql数据库的数据的存放目录[根据本地情况进行修改]
datadir = X:/Ares/bin/mysql/data
#设置3306端口
port = 3306
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysql]
# 设置mysql客户端默认字符集
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 the mysql service
X:\Ares\bin\mysql5.7\bin>net start mysql5.7
mysql5.7 服务正在启动 ..
mysql5.7 服务已经启动成功。

5. Upgrade mysql: mysql_upgrade -uroot -p

X:\Ares\bin\mysql5.7\bin>mysql_upgrade -uroot -p123
.......省略一万字..........

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
mysql 服务正在停止.
mysql 服务已成功停止。
X:\Ares\bin\mysql5.7\bin>net start mysql5.7
mysql5.7 服务正在启动 ..
mysql5.7 服务已经启动成功。

7. The installation and upgrade is completed

.

The above is the detailed content of Share how to upgrade Mysql5.6 to 5.7 under Win. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn