轻松13步骤完成版本升级
1: 下载安装包 mysql-5.7.30-winx64.zip
2: 解压安装包
3:创建 my.ini(放在bin的同级)
# 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]
# 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.
basedir =E:\Mysql5.7\mysql-5.7.30-winx64
datadir =E:\Mysql5.7\mysql-5.7.30-winx64\Data
max_connections=200
character-set-server=utf8
default-storage-engine=INNODB
# 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.
innodb_buffer_pool_size=512M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
4:以管理员身份进入到bin目录下
5:初始化并且添加服务到windows中 mysqld --install mysql5.7.30
6: 启动服务 net start mysql5.7.30
mysql5.7.30 服务正在启动 .
mysql5.7.30 服务无法启动
服务没有报告任何错误。
请键入 NET HELPMSG 3534 以获得更多的帮助。
如果上面的第6步骤出现
就执行第7步骤
7: mysqld --initialize-insecure --user=mysql //无密登陆
8: net start mysql5.7.30
9: 就可以登录了,输入mysql -u root –p按回车键,出现Enter password,因为没有设置登录密码,所以什么都不用输入,直接按回车键即可
10:重置密码 set password for root@localhost = password('root');
11:关闭服务 net stop mysql5.7.30
12:将Data目录复制到该目录下并重启服务(net start mysql5.7.30)
13:移除旧的服务 mysqld --remove 旧服务名称
注意:MySQL免安装版,遇到MSVCR120.dll文件丢失错误的解决方案
在进行mysql zip版本的安装时,遇到上图的错误,在网上找了相关的文件拷贝到相应目录下,但还是不行。
后来终于找到解决方法:下载 VC redist packages for x64,下载完成,点击运行即可。
https://www.microsoft.com/en-us/download/details.aspx?id=40784