关于Windowmysql5.5升级⾄5.7.36的详细步骤
Mysql升级步骤操作如下:
1.⾸先备份原⽂件,并卸载原Mysql
2.进⼊官⽹下载预安装版本
3.写⼊并修改my.ini⽂件
5.尝试客户端登录mysql
5.将原data⽂件覆盖到安装路径下
1.备份原⽂件,并卸载原Mysql
1.1 备份data及安装⽂件
1.1.1 先停⽌mysql服务
1.1.2 到mysql安装路径
因为我⾃⼰创建的数据库并不在安装路径下的data内存储,所以要先通过my.ini配置⽂件到⾃⼰数据库data存放地址,然后将这⾥的data 数据和mysql安装路径下所有⽂件备份
1.2 完全卸载mysql
以管理员⾝份打开cmd ,执⾏命令mysqld -remove,移除现有mysql服务。(注意,最好在执⾏cmd命令时,都以管理员⾝份运⾏,以避免权限不⾜带来的⿇烦)
1. 命令删除服务 sc delete mysql
2. 删除⽂件所在位置的全部⽂件夹,即原安装路径下的⽂件,以及data数据
3. 删除注册表。这三个⽬录下的 services–>eventlog–>system–>mysql⽂件
(这个注册表内的mysql,我并没有到,可能在移除服务时,就⾃动删除了)
2.下载预安装版本,并解压
2.1 下载新版本
2.2 解压安装⽂件
3. 配置my.ini⽂件
新建⼀个my.ini⽂件,并配置该⽂件
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]
port=3306
[mysql]
default-character-set=utf8
# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
mysql下载之后是个文件夹# you have installed the server correctly(see above) so it reads this
# file.
#
[mysqld]
# The TCP/IP Port the MySQL Server will listen on
port=3306
#Path to installation directory. All paths are usually resolved relative to this.
basedir="F:/java1/mysql-5.7.36-winx64"
#Path to the database root
datadir="F:/java1/mysql-5.7.36-winx64/data"
# The default character set that will be used when a new schema or table is
# created and no character set is defined
character-set-server=utf8
# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB
# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
# The maximum amount of concurrent sessions the MySQL server will
# allow. One of these connections will be reserved for a user with
# SUPER privileges to allow the administrator to login even if the
# connection limit has been reached.
max_connections=100
# Query cache is used to cache SELECT results and later return them
# without actual executing the same query once again. Having the query
# cache enabled may result in significant speed improvements,if your
# have a lot of identical queries and rarely changing tables. See the
# "Qcache_lowmem_prunes" status variable to check if the current value
# is high enough for your load.
# Note: In case your tables change very often or if your queries are
# textually different every time, the query cache may result in a
# slowdown instead of a performance improvement.
query_cache_size=0
# The number of open tables for all threads. Increasing this value
# increases the number of file descriptors that mysqld requires.
# Therefore you have to make sure to set the amount of open files
# allowed to at least 4096 in the variable "open-files-limit" in
# section[mysqld_safe]
table_open_cache=256
table_open_cache=256
# Maximum size for internal(in-memory) temporary tables. If a table
# grows larger than this value, it is automatically converted to disk
# based table This limitation is for a single table. There can be many
# of them.
tmp_table_size=35M
# How many threads we should keep in a cache for reuse. When a client
# disconnects, the client's threads are put in the cache if there aren't
# more than thread_cache_size threads from before.  This greatly reduces
# the amount of thread creations needed if you have a lot of new
# connections.(Normally this doesn't give a notable performance
# improvement if you have a good thread implementation.)
thread_cache_size=8
#*** MyISAM Specific options
# The maximum size of the temporary file MySQL is allowed to use while
# recreating the index(during REPAIR, ALTER TABLE or LOAD DATA INFILE.
# If the file-size would be bigger than this, the index will be created
# through the key cache(which is slower).
myisam_max_sort_file_size=100G
# If the temporary file used for fast index creation would be bigger
# than using the key cache by the amount specified here, then prefer the
# key cache method.  This is mainly used to force long character keys in
# large tables to use the slower key cache method to create the index.
myisam_sort_buffer_size=69M
# Size of the Key Buffer, used to cache index blocks for MyISAM tables.
# Do not set it larger than 30% of your available memory, as some memory
# is also required by the OS to cache rows. Even if you're not using
# MyISAM tables, you should still set it to 8-64M as it will also be
# used for internal temporary disk tables.
key_buffer_size=55M
# Size of the buffer used for doing full table scans of MyISAM tables.
# Allocated per thread,if a full scan is needed.
read_buffer_size=64K
read_rnd_buffer_size=256K
# This buffer is allocated when MySQL needs to rebuild the index in
# REPAIR, OPTIMZE, ALTER table statements as well as in LOAD DATA INFILE
# into an empty table. It is allocated per thread so be careful with
# large settings.
sort_buffer_size=256K
注意修改路径basedir是指mysql安装路径,datadir是存放数据库⽂件路径basedir=“F:/java1/mysql-5.7.36-winx64”
datadir=“F:/java1/mysql-5.7.36-winx64/data”
3.1 修改环境变量

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。