当前位置:网站首页>【解决】mysql本地计算机上的MySQL服务启动后停止。某些服务在未由其他服务或程序使用时将自动停止
【解决】mysql本地计算机上的MySQL服务启动后停止。某些服务在未由其他服务或程序使用时将自动停止
2022-07-31 05:56:00 【m0_67401228】
最近写一个Java Web的项目,需要用到 mysql 数据库,在计算机管理中启动时,发现 mysql 报错:mysql本地计算机上的MySQL服务启动后停止。某些服务在未由其他服务或程序使用时将自动停止。该问题的解决方式为:
1 找到 Mysql 的安装路径,看看有没有data文件夹,如果没有data文件夹,自己重新建一个;如果有的话,就把里面的内容全部清空,但保留该目录。
2 打开命令行,进入到mysql 安装目录下的 bin 文件夹,然后输入相关命令:
3 在此命令行中输入 mysqld --initialize ,静待十到二十秒
4 然后结束后,在命令行输入 net start mysql 或在 你的计算机管理器中启动 MySQL
5 查看 mysql 重置的密码,用记事本 打开 data 文件夹下的 .err 文件,搜索 password ,会看到密码重置,由于随机密码不好记,这个时候需要自己重置密码。

6 输入mysql –u root -p 输入上述密码 进入 mysql 环境,
7 然后更改自己能够记忆的密码
set passeord for [email protected]=password('root'); (MySQL 5.7 可以用)
貌似8.0版本,用以上的句子改密码,会出现下面失误:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'password('123456')' at line 1
我直接用下面的命令 成功解决
ALTER user 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';
然后 刷新: flush privileges
8 测试自己修改密码是否成功。
【以上是我的解决过程,希望可以帮到您!】
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在。深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小。自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前。因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
猜你喜欢

文件 - 03 下载文件:根据文件id获取下载链接

接口报错no message avaliable

【云原生】3.3 Kubernetes 中间件部署实战

批量免费文字翻译

Postgresql source code learning (33) - transaction log ⑨ - see the overall process of log writing from the insert record

使用powerDesigner反向工程生成Entity

LeetCode刷题——摆动序列#376#Medium

数据库原理作业2 — JMU

Core Tower Electronics won the championship in the Wuhu Division of the 11th China Innovation and Entrepreneurship Competition

浅析重复线性渐变repeating-linear-gradient如何使用
随机推荐
浅析v-model语法糖的实现原理与细节知识及如何让你开发的组件支持v-model
DDL+DML+DQL
MySql的安装配置超详细教程与简单的建库建表方法
文本三剑客之e`grep,seq文本编辑工具
Install the gstreamer development dependency library to the project sysroot directory
360推送-360推送工具-360批量推送工具
Hook API
Postgresql source code learning (33) - transaction log ⑨ - see the overall process of log writing from the insert record
零样本学习&Domain-aware Visual Bias Eliminating for Generalized Zero-Shot Learning
银河麒麟服务器v10 sp1安装.net6
Chapter 17: go back to find the entrance to the specified traverse, "ma bu" or horse stance just look greedy, no back to search traversal, "ma bu" or horse stance just look recursive search NXM board
浅析瀑布流布局原理及实现方式
二叉树的还原(反序列化)
MySQL系列一:账号管理与引擎
Explain the example + detail the difference between @Resource and @Autowired annotations (the most complete in the entire network)
【Star项目】小帽飞机大战(八)
数据库概论 - MySQL的简单介绍
QFileInfo常规方法
Analysis of the implementation principle and detailed knowledge of v-model syntactic sugar and how to make the components you develop support v-model
Run the NPM will pop up to ask "how are you going to open this file?"