Windows10 MySQL5.7 upgrade to MySQL8.0

Windows10 MySQL5.7 upgrade to MySQL8.0

Step1: Stop MySQL service first

Next is to uninstall the old MySQL5.7, remember to back up the database before uninstalling~

Step2: Uninstall all MySQL related programs

Insert picture description here

Step3: My previous MySQL installation directory for 5.7 is on the C drive, first open C:\Program Files and delete the previous MySQL folder Insert picture description here

Step4: Open the hidden folder ProgramData and delete the following MySQL folder Insert picture description here

The next step is to uninstall the MySQL related registry, you must be careful here! !

Step1: Windows+R–>regedit–>Open the registry.
Insert picture description here
Step2: Open and delete according to the path:
HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/Eventlog/Applications/MySQL HKEY_LOCAL_MACHINE/SYSTEM/ControlSet002/Services/Eventlog/Applications/MySQL HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Eventlog/Applications/MySQL HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services一般服务会以相同的名字(名字通常是MySQL)
There is also F3 or Ctrl+F to open the search box, enter MySQL, pay attention to the computer,
there is an important step to delete Connector Net XXX registry, many of the reasons for your failure are also on this registry.
Insert picture description here
Step3: Directly delete the detected MySQL registry.
Insert picture description here
After completing the above four steps, MySQL has been uninstalled, and you can install 8.0.

The next step is to install MySQL8.0

Go to the official website to download. The version I downloaded here is mysql-8.0.17-winx64. The version is relatively new. The installation of the 8.0 decompression version is very easy. It can be used after decompression and configuration. I recommend installing the decompression version.

First download Mysql8.0, download address: click me to download from the official website
Insert picture description here

After downloading the community version of MySQL8.0, unzip it to the folder you want to install, and then add environment variables

Add a new
variable: MYSQL_HOME Value: E:\Program Files\mysql-8.0.17-winx64
Note that the path is changed to your installation path
Insert picture description here

Then add
%MYSQL_HOME%\bin after the path variable

Then go to the bin directory Shift+right mouse button to open the Dos window [ Be sure to run as an administrator (emphasis!!!) ]

Step1 Execute the initialization command:

mysqld --initialize --user=mysql --console
(Remember that initialization must be performed. Many people will get 1067 errors if they do not perform initialization. I can’t figure it out.) After the initialization is completed, a temporary password will be generated. Please remember the temporary password.

Then generate some files in your database save directory, don't worry about it.
Insert picture description here

Step2: You can reopen a cmd to proceed, or wait for the result to be completely output

Then enter mysqld -install to add services
mysqld -install MySql80

Step3: Then enter services.msc in Win+R

Find MySQL80 in the service and start itHere is the quote

Step4: Set the database password

mysql -u root -pLog in to the database, because there is no login password, so the first time you log in, just press Enter to log in.
Set the root password:
alter user'root'@'localhost' IDENTIFIED BY 'root';

At this point, the upgrade is basically complete~

The problems you may encounter are as follows:

Connection error 2058 is reported.
Solution: Cmd login mysql -u root -p in windows to log in to your mysql database, and then execute this SQL:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

Report ERROR 1045 (28000): Access denied for user'root'@'localhost' (using
password: YES)
The reference address of the solution: https://blog.csdn.net/qq_27820551/article/details/101488430

A 2059 error occurs when navicat connects to mysql.
Insert picture description here
Reference address: https://www.cnblogs.com/wu-guo-xing/p/9970244.html

Guess you like

Origin blog.csdn.net/m0_43413873/article/details/111570909