卸载
1.卸载软件
在应用与功能中找到Mysql进行卸载
两个都需要卸载
点击OK就行
注意:
- mysql服务也会卸载
- mysql的数据文件不会被卸载
2.删除环境变量
3.删除注册表
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL服务 目录删除
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\MySQL服务 目录删除
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL服务 目录删除
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\MySQL服务 目录删除
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MySQL服务目录删除
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL服务删除
注:上面的有些可能没有
下载
官网地址:https://dev.mysql.com/downloads/windows/installer/8.0.html
选择第二个
官网下载会很慢,如果不开vpn的话
这里可以直接在我的csdn下载进行下载https://download.youkuaiyun.com/download/ppjsyw/85853930 (无需积分)
安装
1.双击安装包
2.选择自定义安装,然后点击next
3.选择mysql
4.点击右边的mysql,然后点击Advanced Options

提示这样的就成功
10.连接到Mysql
# u后面是用户名,p后面是密码,u和p后面都可以带空格
C:\Users\hq>mysql -uroot -proot
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 8.0.29 MySQL Community Server - GPL
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>