当前位置:网站首页>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是你要删除的服务名
这样一来服务就被删除了。
边栏推荐
- Embedded systems are inherently flawed. Compared with the Internet, there are so many holes that it is simply difficult to walk away from
- You need to use MySQL in the opening experiment. How can you forget the basic select statement? Remedy is coming~
- Synchronization control between tasks
- Implementing distributed lock with redis
- Fundamentals of Electronic Technology (III)__ Fundamentals of circuit analysis__ Basic amplifier operating principle
- 端午节快乐!—— canvas写的粽子~~~~~
- Raspberry pie installation SciPy
- 1300. sum of varied array closed to target
- 学历是一张通行证,门票,你有了它,可以踏入更高层次的环境里
- Simple use of MySQL (addition, deletion, modification and query)
猜你喜欢
UCI and data multiplexing are transmitted on Pusch - determine the bit number of harqack, csi1 and csi2 (Part II)
內存數據庫究竟是如何發揮內存優勢的?
Characteristics of PUCCH formats
[male nanny style] teach you to open the first wechat applet
学历是一张通行证,门票,你有了它,可以踏入更高层次的环境里
Shell logic case
Development of electrical fire system
How MySQL modifies null to not null
Definition and use of enum in C language
Code word in NR
随机推荐
Leetcode daily question (2232. minimize result by addressing parents to expression)
Fundamentals of Electronic Technology (III)__ Chapter 1 resistance of parallel circuit
PRACH --- originator
【顺利毕业】[1]-游览 [学生管理信息系统]
Leetcode daily question (985. sum of even numbers after queries)
[graduation successful] [1] - tour [Student Management Information System]
Nodemcu-esp8266 development (vscode+platformio+arduino framework): Part 4 --blinker_ DHT_ WiFi (lighting technology app control + temperature and humidity data app display)
嵌入式本来就很坑,相对于互联网来说那个坑多得简直是难走
Leetcode daily question (1024. video sticking)
[combinatorics] Introduction to Combinatorics (combinatorial thought 2: mathematical induction | mathematical induction promotion | multiple induction thought)
How MySQL modifies null to not null
UCI and data multiplexing are transmitted on Pusch - placement of data and UCI positions (Part III)
Exception handling of arm
When you need to use some functions of STM32, but 51 can't realize them, 32 naturally doesn't need to learn
Design and development of biological instruments
Getting started with JMX, MBean, mxbean, mbeanserver
Electronic product design
The third paper of information system project manager in soft examination
Eight working modes of stm32gpio and chip naming rules
STM32 serial port usart1 routine