Windows 下Mysql 手动升级到 8.0.13

Mysql 升级到8.0.13

  • 下载Mysql安装包
  • 卸载Mysql服务
    • sc delete 需要管理员权限
  • 安装Mysql8.0.13
    • 配置文件
    • 配置环境变量

下载Mysql安装包

在mysql的官网1下载mysql8.0.13版本压缩包
Windows 下Mysql 手动升级到 8.0.13_第1张图片

卸载Mysql服务

sc delete 需要管理员权限

C:\WINDOWS\system32>sc delete
描述:
        从注册表删除服务项。
        如果服务正在运行,或另一进程已经打开
        到此服务的句柄,服务将简单地标记为
        删除。
用法:
        sc  delete [service name]

C:\WINDOWS\system32>sc query mysql

SERVICE_NAME: mysql
        TYPE               : 10  WIN32_OWN_PROCESS
        STATE              : 1  STOPPED
        WIN32_EXIT_CODE    : 1077  (0x435)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

C:\WINDOWS\system32>sc delete mysql
[SC] DeleteService 成功

C:\WINDOWS\system32>

安装Mysql8.0.13

配置文件

找到原来安装目录的 .ini文件, Mysql服务启动时候会读取 .ini配置文件
Windows 下Mysql 手动升级到 8.0.13_第2张图片

将my-default.ini文件复制到新下载的压缩包中,为了沿用原来数据库的数据,在这里只修改 basedir, 其它的保持不变

Windows 下Mysql 手动升级到 8.0.13_第3张图片

.ini文件如下

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]
explicit_defaults_for_timestamp=true
log_timestamps=SYSTEM
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
[client]
port=3306
default-character-set=utf8
[mysqld]
#basedir = D:\DataBase\MySQL\mysql-5.7.19-winx64
basedir = D:\DataBase\MySQL\mysql-8.0.13-winx64
datadir = D:\DataBase\MySQL\mysql-5.7.19-winx64\data
port = 3306
character_set_server=utf8
# server_id = 


# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

配置环境变量

在这里插入图片描述

使用管理员权限安装

D:\DataBase\MySQL\mysql-8.0.13-winx64\bin>mysqld install
Service successfully installed.

启动服务
Windows 下Mysql 手动升级到 8.0.13_第4张图片

登录Mysql查看数据

Windows 下Mysql 手动升级到 8.0.13_第5张图片

数据也过来了,注意,原来的data目录不能删除。如果想删除,可以把data文件夹复制到mysql8.0.13
目录下,修改.ini文件的datadir路径

  1. Mysql官网下载地址 ↩︎

你可能感兴趣的:(Mysql)