windows MYSQL安装与卸载

卸载

1.卸载软件

在应用与功能中找到Mysql进行卸载

image-20220701215402671

两个都需要卸载

image-20220701215509829

点击OK就行

注意:

  1. mysql服务也会卸载
  2. mysql的数据文件不会被卸载

2.删除环境变量

image-20220701215928899

image-20220701215943260

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

image-20220701221940786

选择第二个

image-20220701222000471

官网下载会很慢,如果不开vpn的话

这里可以直接在我的csdn下载进行下载https://download.csdn.net/download/ppjsyw/85853930 (无需积分)

安装

1.双击安装包

image-20220701223102484

2.选择自定义安装,然后点击next

image-20220701223317085

3.选择mysql

image-20220701224050046

4.点击右边的mysql,然后点击Advanced Options

image-20220701224148410

![image-20220701224402555](https://asaadsasa.oss-cn-beijing.aliyuncs.com/image-20220701224402555.png

在这可以选择mysql服务端的安装位置和mysql数据的位置,选完之后点击OK

再点击OK,然后再点击Next

5.点击Next

image-20220701224551916

在本界面也可以选择服务端安装位置和数据存储位置,然后点击Next

image-20220701224638923

提示data位置已存在,点击yes,忽略警告

6.完成安装

image-20220701224959245

点击execute

image-20220701225019536

点击next

image-20220701225143613

再点击next

7.配置

image-20220701225349997

默认3306,不用改,直接点击next

image-20220701225452028

mysql8.0才有的,直接点击next即可

image-20220701233308159

默认有个账户叫root,然后输入密码,在下面也可以添加用户

image-20220701233409904

点击Ok

image-20220701233421031

点击next

8.完成配置

image-20220701233630817

默认会勾上Start the Mysql server at System startup,然后点击next

image-20220701233722601

点击execute

image-20220701234943559

点击finish完成配置

9.配置环境变量

新建MYSQL_HOME,路径指向mysql服务端的bin目录

image-20220701234128509

在path系统变量新建%MYSQL_HOME%

image-20220701234211649

验证

C:\Users\hq>mysql --version
mysql  Ver 8.0.29 for Win64 on x86_64 (MySQL Community Server - GPL)

提示这样的就成功

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>
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值