在 MySQL 5.6 中重置 ROOT 密码

2023-06-03数据库问题
2

本文介绍了在 MySQL 5.6 中重置 ROOT 密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我一直在按照这些说明来重置root 在 Windows 7 笔记本电脑上本地安装 MySQL 5.6 的密码.

I have been following these instructions for resetting root password for local installation of MySQL 5.6 on Windows 7 laptop.

我停止了服务,创建了init-file,并运行了以下命令(以管理员身份):

I stopped the service, created init-file, and ran the following command (as Administrator):

"C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.6\my.ini" --init-file=C:\\MySQL-misc\\mysql-init.txt

我收到以下警告:

2014-02-08 15:44:10 0 [警告] 带有隐式默认值的时间戳已弃用.请使用 --explicit_defaults_for_timestamp 服务器选项(有关详细信息,请参阅文档).

2014-02-08 15:44:10 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

由于这是一个警告,我不确定是否需要修复任何内容,然后再次重做该过程.

Since it's a warning I'm not sure whether I need to fix anything and then redo the process again.

当前命令窗口仍然打开并且不接受任何输入.我应该强制关闭它还是我可以做些什么来优雅地完成这个过程?

Currently the command window is still on and does not accept any input. Should I force-close it or is there anything I can do to complete the process gracefully?

更新

我关闭了命令窗口并尝试重新启动服务.有错误.

I killed the Command window and tried to restart the service. Got an error.

重新启动 Windows,服务自动启动. root 密码 似乎有效.成功使用Workbench各种需要密码的功能.

Restarted Windows and the service automatically started. The new root password seems to work. I was successfully able to use various functions of Workbench that require the password.

所以,警告确实只是一个警告.

So, the warning was indeed just a warning.

推荐答案

问题已经解决.

如我的问题所述,我遵循了MySQL手册中的说明.

As stated in my question I followed instructions from MySQL manual.

过程没有像描述的那样完全(这就是我发布原始帖子的原因),但它仍然有效(请参阅我帖子中的更新部分).

The process did not go exactly as described (and this was the reason for my original post) but it worked nevertheless (see UPDATE section in my post).

这篇关于在 MySQL 5.6 中重置 ROOT 密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

Mysql目录里的ibtmp1文件过大造成磁盘占满的解决办法
ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致...
2025-01-02 数据库问题
151

SQL 子句“GROUP BY 1"是什么意思?意思是?
What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)...
2024-04-16 数据库问题
62

MySQL groupwise MAX() 返回意外结果
MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)...
2024-04-16 数据库问题
13

MySQL SELECT 按组最频繁
MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)...
2024-04-16 数据库问题
16

为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同
Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)...
2024-04-16 数据库问题
13

MySQL GROUP BY DateTime +/- 3 秒
MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)...
2024-04-16 数据库问题
14