当前位置:网站首页>Install Mysql8.0 on windos, and solve the problem of re-login exception ERROR 1045 (28000)
Install Mysql8.0 on windos, and solve the problem of re-login exception ERROR 1045 (28000)
2022-08-09 22:37:00 【QLH0101】
mysqlInstallation and exception resolution
1、下载安装包
下载地址:https://dev.mysql.com/downloads/mysql/
点击下载之后,可以选择注册Oracle账号,也可以跳过直接下载.
下载完成后,选择一个磁盘内放置并解压.
If the official website turtle speed download,It is recommended to use the following mirror images.相对的~
Mysql国内镜像:http://mirrors.sohu.com/mysql/MySQL-8.0/
下载完成之后,解压即可!
2、安装教程
(1)、配置环境变量
变量名:MYSQL_HOME
变量值:E:\mysql-5.7.20-winx64
(2)、生成data文件
以管理员身份运行cmd
进入E:\python\mysql\mysql-8.0.12-winx64\bin>下(这里在说一下:这里的路径需要根据自己的实际安装位置进行调整,总之就是刚刚解压的文件放在那,就在哪打开)
执行命令:mysqld --initialize-insecure --user=mysql This step can be completedE:\python\mysql\mysql-8.0.12-winx64Check the directory to see if it is generateddata目录,This exception may also exist,解决方案如下:
(3)、安装MySQL
继续执行命令:mysqld -install
(4)、启动服务
继续执行命令:net start MySQL
(5)、登录MySQL
登录mysql:(因为之前没设置密码,所以密码为空,不用输入密码,直接回车即可)
E:\python\mysql\mysql-8.0.12-winx64\bin>mysql -u root -p
(6)、查询用户密码
查询用户密码命令:mysql> select host,user,authentication_string from mysql.user;
(7)、设置(或修改)root用户密码
mysql> use mysql;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
mysql> flush privileges;
flush privileges; 作用:相当于保存,执行此命令后,设置才生效,若不执行,还是之前的密码不变,可以多输入几次
(8)、退出
mysql> quit

(9)、再次登录
3、ERROR 1045 (28000)解决方案.
Re-login if this exception exists: ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
关于修改密码再次登录出现ERROR的解决方案:
首先问题出现的原因在于可能是因为版本不同,命令有所差异.
如果你是按照上面的完整教程安装出现这种问题的解决方案:
3.1、所有东西都删除,然后重装,按照上面教程再来一遍;
3.2、如果你之前装了,报错之后就一直放在那里,现在请严格按照下面步骤进行:
3.2.1、打开cmd,切换到mysql的bin目录下,输入命令net stop mysql,停止mysql服务;

3.2.2、打开mysql的安装目录,找到data文件夹,将其删除!

3.2.3、回到cmd命令窗口,输入mysqld -remove

3.2.4、接下来按照上面教程,从第二步生成data文件开始执行,一定要注意修改密码那里:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
边栏推荐
- Beat the interviewer, the CURD system can also make technical content
- DP-Differential Privacy概念介绍
- Week 8 Deep learning for object detection
- Toronto Research Chemicals加米霉素-d4说明书
- DSPE-PEG-PDP, DSPE-PEG-OPSS, phospholipid-polyethylene glycol-mercaptopyridine reduce the immunogenicity of peptides
- Can I make a TCP connection without accept?
- PCL学习之滤波Filtering
- 【Jmeter】分布式搭建
- DSPE-PEG-Silane,DSPE-PEG-SIL,磷脂-聚乙二醇-硅烷修饰二氧化硅颗粒用
- URL Protocol web page to open the application
猜你喜欢
随机推荐
Unity2D_线框材质
大健康产业商业供应链管理系统数字化提升产业链运作效率推动供应链标准化建设
Acrel5000web能耗系统在某学院的应用-Susie 周
【NOI模拟赛】防AK题(生成函数,单位根,Pollard-Rho)
Jmeter 使用正则表达式提取器将返回值全部保存到一个文件中
LED闪烁 闪灯芯片IC 手电筒IC 闪灯控制IC 闪烁IC流水灯
Next second data: the transformation of the modern data stack brought about by the integration of lake and warehouse has begun
Cholesterol-PEG-Thiol,CLS-PEG-SH,胆固醇-聚乙二醇-巯基用于改善溶解度
Access Characteristics of Constructor under Inheritance Relationship
如何从800万数据中快速捞出自己想要的数据?
DSPE-PEG-PDP, DSPE-PEG-OPSS, phospholipid-polyethylene glycol-mercaptopyridine reduce the immunogenicity of peptides
智能家居设备安全分析技术综述
力扣15-三数之和——HashSet&双指针法
How to deal with keys when Redis is large?
DSPE-PEG-Silane,DSPE-PEG-SIL,磷脂-聚乙二醇-硅烷修饰二氧化硅颗粒用
Unity_物体自转
axi4c
PyTorch框架的 torch.cat()函数
分数阶混沌系统李雅普指数和分岔图
纸业供应链协同管理系统:重构纸业智慧供应网络,支撑企业数字化转型升级








![[corctf 2022] 部分](/img/03/ee1ead55805a2ac690ec79c675c3e6.png)
