当前位置:网站首页>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是你要删除的服务名
这样一来服务就被删除了。
边栏推荐
- 单片机学到什么程度能找到工作,这个标准不好量化
- Nodemcu-esp8266 development (vscode+platformio+arduino framework): Part 4 --blinker_ DHT_ WiFi (lighting technology app control + temperature and humidity data app display)
- Electronic product design
- GPIO port details, Hal library operation keys
- I didn't think so much when I was in the field of single chip microcomputer. I just wanted to earn money to support myself first
- [combinatorics] Introduction to Combinatorics (combinatorial thought 2: mathematical induction | mathematical induction promotion | multiple induction thought)
- Nr-prach:prach format and time-frequency domain
- Process communication - semaphore
- 学历是一张通行证,门票,你有了它,可以踏入更高层次的环境里
- Mysql database underlying foundation column
猜你喜欢
![[csdn] C1 analyse des questions de formation Partie III Bar _ JS Foundation](/img/b2/68d53ad09688f7fc922ac65e104f15.png)
[csdn] C1 analyse des questions de formation Partie III Bar _ JS Foundation

应用最广泛的8位单片机当然也是初学者们最容易上手学习的单片机

Nr--- Pusch I: sorting out the agreement process

Uniapp realizes global sharing of wechat applet and custom sharing button style

JMX、MBean、MXBean、MBeanServer 入门

要選擇那種語言為單片機編寫程序呢

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

当你需要使用STM32某些功能,而51实现不了时, 那32自然不需要学

Oracle database SQL statement execution plan, statement tracking and optimization instance

Programming ideas are more important than anything, not more than who can use several functions, but more than the understanding of the program
随机推荐
Implementing distributed lock with redis
Mysql database underlying foundation column
Programming ideas are more important than anything, not more than who can use several functions, but more than the understanding of the program
Matlab reads hexadecimal numbers and converts them into signed short
Error output redirection
UCI and data multiplexing are transmitted on Pusch (Part V) -- polar coding
Synchronization control between tasks
Idea remote breakpoint debugging jar package project
NR technology -- MIMO
Project cost management__ Cost management technology__ Article 7 completion performance index (tcpi)
Epollet lessons
Development of fire evacuation system
要选择那种语言为单片机编写程序呢
The third paper of information system project manager in soft examination
我想各位朋友都应该知道学习的基本规律就是:从易到难
When you need to use some functions of STM32, but 51 can't realize them, 32 naturally doesn't need to learn
端午节快乐!—— canvas写的粽子~~~~~
Stm32-hal library learning, using cubemx to generate program framework
There is no specific definition of embedded system
Uniapp realizes global sharing of wechat applet and custom sharing button style