[Installation tutorial] MySQL complete uninstallation and installation tutorial

MySQL complete uninstallation and installation tutorial


Uninstall

1. Stop mysql service in task manager

Insert picture description here

  1. Uninstall the MySQL application in the control panel

Insert picture description here

  1. Delete Mysql related files
  • Delete the mysql folder inside
    Insert picture description here

4. Delete the registry

Insert picture description here

  • Delete the content:

删除HKEY_LOCAL_MACHIN->ControlSet001->SYSTEM-> service->MySQL;

删除HKEY_LOCAL_MACHINE->ControlSet002-> SYSTEM-> services->MySQL;

删除HKEY_LOCAL_MACHINE->CurrentControlSet-> SYSTEM-> services->MySQL

If not, it means it has been uninstalled cleanly!

installation

Disclaimer: I won’t talk about the exe version here, just go to the official website to download it and install it with one click.
Suggestion: Use the compressed version to uninstall!

Here's how to install the compressed version:

Go to the official website to download the corresponding version of the compressed package, I am here to take 5.7 as an example

Insert picture description here

Insert picture description here

Unzip after download

Insert picture description here

Enter the unzipped directory

Create a my.ini file:
Insert picture description here

The configuration is as follows:

	
[mysqld]
# 端口号
port=3306
# 压缩包目录
basedir=D:/DataBase/soft/mysql-5.7/
# 等会儿生成的data目录,用来存放数据的
datadir=D:/DataBase/soft/mysql-5.7/data/

# 跳过密码检查
skip-grant-tables

note:这里记得配置目录的斜杠方向 ‘ / ’,我就踩了这个坑,不然后面初始化目录会失败

Run CMD as administrator

Insert picture description here

Switch to the bin directory of the mysql decompression directory

cd /d D:\DataBase\soft\mysql-5.7\bin

Run the command to install the mysql service

Must be executed in the bin directory

Insert picture description here

mysqld -install

Initialization data

mysqld --initialize-insecure --user=mysql

After successful execution here, a data folder will be generated in the mysql directory

Insert picture description here

After success, start the service

net start mysql

Insert picture description here

Login to mysql

Note that there is no password here, so there is no need to enter a password

mysql -u root -p

Insert picture description here

Don't write anything here, just press Enter!

This shows that the login is successful:
Insert picture description here

After entering, update the password

update mysql.user set authentication_string=password('121891') where user='root' 
and Host = 'localhost';

Refresh permissions

flush privileges;

Before deleting, the password configured in my.ini skips checking the configuration

Insert picture description here

Restart MySql

net stop mysql
net start mysql

Insert picture description here

At this point, the installation is complete!

Guess you like

Origin blog.csdn.net/qq_42380734/article/details/107742687