当前位置:网站首页>Windows下MySQL的安装和删除
Windows下MySQL的安装和删除
2022-07-03 09:15:00 【look-word】
Windows下MySQL的安装和删除
安装Mysql
1 下载mysql


2 安装教程
2.1配置环境变量
变量名:MYSQL_HOME
变量值:D:\software\programming\environment\mysql-8.0.29-winx64 // bin目录的上级目录
- 一定记得要确定 保存
- 一定记得要确定 保存
- 一定记得要确定 保存
- 一定记得要确定 保存

2.2生成data文件
以管理员身份运行cmd

进入D:\software\programming\environment\mysql-8.0.29-winx64\bin>下(这里在说一下:这里的路径需要根据自己的实际安装位置进行调整,总之就是刚刚解压的文件放在那,就在哪打开~)
执行命令:mysqld --initialize-insecure --user=mysql 在D:\software\programming\environment\mysql-8.0.29-winx64目录下生成data目录
2.3安装MySQL
继续执行命令:mysqld -install

2.4启动服务
继续执行命令:net start MySQL

2.5登录MySQL
登录mysql:(因为之前没设置密码,所以密码为空,不用输入密码,直接回车即可)
E:\python\mysql\mysql-8.0.12-winx64\bin>mysql -u root -p

2.6查询用户密码
查询用户密码命令:mysql> select host,user,authentication_string from mysql.user;

2.7设置(或修改)root用户密码
mysql> use mysql

修改密码(记得保存)
ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘123456’;

flush privileges;
作用:相当于保存,执行此命令后,设置才生效,若不执行,还是之前的密码不变

2.8 退出
mysql> quit
2.9 测试登陆

如无法登陆
- 按照下面删除步骤 删除完成
- 在重装

彻底删除Mysql
删除的基础条件 停止MySQL的运行
将MySQL服务停止,这里我只有一个MySQL服务,如有多个MySQL服务,也要全部停止掉。

- net stop 要删除的mysql服务的名称

卸载mysql server等设备

删除MySQL安装目录下的MySQL文件夹
- 这个文件目录找不到别找着急 下面步骤能找到

打开注册表编辑器,删除注册表
利用快捷键win+R,输入“regedit”,回车,打开注册表编辑器

如果没有相应的文件夹,就不用删除了。
删除 HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL 文件夹
删除 HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL 文件夹。
删除 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MySQL
文件夹。
mysql的位置

删除目录“C:\ProgramData\MySQL”文件夹
删除目录C:\ProgramData\MySQL文件夹,如果显示正在被其他应用所使用,无法进行删除,那么就需要重新启动电脑,就可以删除了。
再次打开服务,查看是否有MySQL卸载残留
如果已经将MySQL卸载,但通过开始 -》所有应用 -》Windows管理工具 -》服务查看到MySQL服务仍然残留在系统服务里。
又不想改服务名,改怎么办呢。
只要在CMD里输入一条命令就可以将服务删除:sc delete mysql //这里的mysql是你要删除的服务名
这样一来服务就被删除了。
边栏推荐
- UCI and data multiplexing are transmitted on Pusch (Part VI) -- LDPC coding
- MySQL的简单使用(增删改查)
- [CSDN]C1训练题解析_第二部分_Web基础
- CEF download, compile project
- Project cost management__ Cost management technology__ Article 6 prediction
- PRACH --- originator
- In third tier cities and counties, it is difficult to get 10K after graduation
- 手机都算是单片机的一种,只不过它用的硬件不是51的芯片
- Project scope management__ Scope management plan and scope specification
- Stm32-hal library learning, using cubemx to generate program framework
猜你喜欢

UCI and data multiplexing are transmitted on Pusch (Part VI) -- LDPC coding

UCI and data multiplexing are transmitted on Pusch - placement of data and UCI positions (Part III)

MySQL data manipulation language DML common commands

UCI and data multiplexing are transmitted on Pusch - determine the bit number of harqack, csi1 and csi2 (Part II)

新系列单片机还延续了STM32产品家族的低电压和节能两大优势

Seven sorting of ten thousand words by hand (code + dynamic diagram demonstration)

Happy Dragon Boat Festival—— Zongzi written by canvas~~~~~

Comment la base de données mémoire joue - t - elle l'avantage de la mémoire?

In third tier cities and counties, it is difficult to get 10K after graduation

Nodemcu-esp8266 development (vscode+platformio+arduino framework): Part 4 --blinker_ DHT_ WiFi (lighting technology app control + temperature and humidity data app display)
随机推荐
单片机现在可谓是铺天盖地,种类繁多,让开发者们应接不暇
STM32 interrupt switch
Convert IP address to int
顺利毕业[3]-博客系统 更新中。。。
Nr--- Pusch I: sorting out the agreement process
2021-09-26
手机都算是单片机的一种,只不过它用的硬件不是51的芯片
Getting started with shell programming
Raspberry pie installation SciPy
uniapp 实现微信小程序全局分享及自定义分享按钮样式
Development of fire evacuation system
[graduation successful] [1] - tour [Student Management Information System]
The cyclic shift of PUCCH in NR channel is generated by MATLAB
Code word in NR
Leetcode daily question (2109. adding spaces to a string)
JMX、MBean、MXBean、MBeanServer 入门
Programming ideas are more important than anything, not more than who can use several functions, but more than the understanding of the program
Leetcode daily question (2232. minimize result by addressing parents to expression)
PRACH --- originator
Eight working modes of stm32gpio and chip naming rules