当前位置:网站首页>Detailed steps for upgrading window mysql5.5 to 5.7.36
Detailed steps for upgrading window mysql5.5 to 5.7.36
2022-07-05 12:22:00 【A finger leaf next to the giant】
Mysql The upgrade steps are as follows :
1. First, back up the original file , And unload the original Mysql
2. Go to the official website to download the pre installed version
3. Write and modify my.ini file
4.cmd Install and change the password under the command
5. Try client login mysql
5. The original data The file is overwritten under the installation path
6.cmd Next initialization operation , Upgrade data dictionary
1. Back up the original file , And unload the original Mysql
1.1 Backup data And installation files
1.1.1 First stop mysql service
1.1.2 find mysql The installation path
Because the database I created is not under the installation path data Memory , So first pass my.ini The configuration file finds its own database data Storage address , And then put the data Data and mysql Backup all files in the installation path
1.2 Uninstall completely mysql
Open as administrator cmd , Carry out orders mysqld -remove, Remove existing mysql service .( Be careful , It's best to implement cmd On command , All run as administrators , To avoid the trouble caused by insufficient permissions )
Command delete service sc delete mysql
Delete all folders where the files are located , That is, the files under the original installation path , as well as data data
Delete registry . Under these three directories services–>eventlog–>system–>mysql file
( In this registry mysql, I didn't find , Maybe when removing the service , It will automatically delete )
2. Download pre installed version , And extract the
2.1 Download the new version
Go to the official website to download 5.7 The latest version
https://downloads.mysql.com/archives/community/
2.2 Unzip the installation file
3. To configure my.ini file
Create a new one my.ini file , And configure the file
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# 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
# 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
# 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
Pay attention to modifying the path basedir Refer to mysql The installation path ,datadir Is the path where the database file is stored
basedir=“F:/java1/mysql-5.7.36-winx64”
datadir=“F:/java1/mysql-5.7.36-winx64/data”
3.1 Modify environment variables
4. Import data file
The original data Copy the database file to the installation path
5. cmd Install and change the password under the command
Open as administrator cmd, Do the following
1. remove mysql
mysqld -remove
2. install mysql
mysqld -install
3. initialization mysql.
Successful initialization will occur in my.ini It is automatically generated under the file directory where it is located date Folder , At this time, there is nothing in the folder .
mysqld --initialize --console
here , Generated a temporary password , You can remember , But you can also change the password directly next .
- start-up mysql service
net start mysql
If the following error occurs :
hold date All error files in the folder 、log After the files are deleted . There is no mistake .
Restart service , It's started successfully !
4.2 Change Password
Copy someone else's , Just press the operation
1、 Start → Enter... In the search box cmd → Right click cmd.exe Choose to run as Administrator ( Or in C:\Windows\System32 Find this in the directory cmd.exe, Right click , Run as administrator )
2、 Input net stop mysql stop it MySQL service
3、 Enter the command line to mysql Of bin Under the table of contents , Enter the following bold commands ( Change the file location according to your actual situation )
C:\MySQL\bin>mysqld --defaults-file=“C:\MySQL\my.ini” --console --skip-grant-tables
wait a minute , The following results are shown MySQL start-up :
170215 22:26:09 [Warning] The syntax ‘–log’ is deprecated and will be removed inMySQL 7.0. Please use ‘–general_log’/’–general_log_file’ instead.
170215 22:26:09 [Warning] The syntax ‘–log_slow_queries’ is deprecated and will be removed in MySQL 7.0. Please use ‘–slow_query_log’/’-- slow_query_log_file’ instead.
170215 22:26:09 [Warning] The syntax ‘–log’ is deprecated and will be removed in MySQL 7.0. Please use ‘–general_log’/’–general_log_file’ instead.
170215 22:26:09 [Warning] The syntax ‘–log_slow_queries’ is deprecated and will be removed in MySQL 7.0. Please use ‘–slow_query_log’/’–slow_query_log_file’ instead.
170215 22:26:09 [ERROR] The update log is no longer supported by MySQL in version 5.0 and above. It is replaced by the binary log. Now starting MySQL with --log-bin=’’ instead.
170215 22:26:09 InnoDB: Started; log sequence number 0 324221
170215 22:26:09 [Note] mysqld: ready for connections.Version: ‘5.1.33-community-log’ socket: ‘’ port: 3306 MySQL Community Server (GPL)
4、 Open another one as an administrator cmd.exe, Enter the command line to mysql Of bin Under the table of contents , Input :mysql -uroot mysql
5、 Get into mysql after , Enter the command line to change the password :
mysql>update user set authentication_string=password(‘123456’) where user=‘root’;
6、 Refresh the permissions :mysql>flush privileges;
7、 sign out mysql:mysql> quit;
8、 close MySQL:D:\MySQL\bin>mysqladmin shutdown( There is an error , be :mysqladmin -uroot -p shutdown Then enter the new password )
9、 At this point, the password change is complete , You can enter the command line :net start mysql start-up MySQL service ,mysql -uroot -p , Enter the password to enter mysql 了 .
6. Resolve version conflicts
Enter , To upgrade the data dictionary :
mysql_upgrade -u root -p --force
The second step : Restart mysql Service for :
net stop mysql
net start mysql
Run again mysql
7. Client login mysql
Generally, you can login successfully here , Here are some possible problems , And solutions
Run as administrator mysqld --console The following error occurred ,
The innodb_system data file ‘ibdata1‘ must be writable
It is caused by insufficient permissions of relevant files , Can be These three documents are solved by modifying the document Authority : Right click Properties -> Security -> Set the highest level permissions
Restart after modification mysql service , Try the command again , There will be no mistakes .
adopt cmd You can enter with password mysql, But in use sqlyog Sign in mysql The following error occurred : The solution is as follows :
link Note that here is another line to change the password
update mysql.user set authentication_string=password(' Here is your new password ') where user='root' ;
Otherwise, the following errors will appear ..
If there is a problem with the wrong password
Here again through cmd The window enters mysql,
And change the password
mysql -uroot -p , Enter the password to enter mysql 了 .
Then change the password
update mysql.user set authentication_string=password(' Here is your new password ') where user='root' ;
Then open the service , find mysql After restarting the service, you can enter .
If the password cannot be changed , Just follow this operation in detail :
link
Reference documents :
https://blog.csdn.net/weixin_42132325/article/details/114475122
https://blog.csdn.net/weixin_39717865/article/details/110870157
边栏推荐
- Design of music box based on assembly language
- 投资理财适合女生吗?女生可以买哪些理财产品?
- byte2String、string2Byte
- byte2String、string2Byte
- PXE startup configuration and principle
- [HDU 2096] 小明A+B
- HiEngine:可媲美本地的云原生内存数据库引擎
- MySQL view
- ZABBIX 5.0 - LNMP environment compilation and installation
- Linux Installation and deployment lamp (apache+mysql+php)
猜你喜欢
Redis's memory elimination mechanism, read this article is enough.
What is digital existence? Digital transformation starts with digital existence
Understand kotlin from the perspective of an architect
Wireless WiFi learning 8-channel transmitting remote control module
Interviewer: is acid fully guaranteed for redis transactions?
Matlab struct function (structure array)
Automated test lifecycle
调查显示传统数据安全工具在60%情况下无法抵御勒索软件攻击
Simple production of wechat applet cloud development authorization login
Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter
随机推荐
How to recover the information server and how to recover the server data [easy to understand]
Redis's memory elimination mechanism, read this article is enough.
只是巧合?苹果 iOS16 的神秘技术竟然与中国企业 5 年前产品一致!
Intern position selection and simplified career development planning in Internet companies
II. Data type
Take you two minutes to quickly master the route and navigation of flutter
MySQL function
Seven ways to achieve vertical centering
Error modulenotfounderror: no module named 'cv2 aruco‘
abap查表程序
Mmclassification training custom data
Learn memory management of JVM 01 - first memory
Understand redis persistence mechanism in one article
Matlab boundarymask function (find the boundary of the divided area)
Use and install RkNN toolkit Lite2 on itop-3568 development board NPU
Select drop-down box realizes three-level linkage of provinces and cities in China
MySQL installation, Windows version
[pytorch pre training model modification, addition and deletion of specific layers]
MySQL data table operation DDL & data type
Redis highly available slice cluster