MYsql 数据库密码忘记(Window)
之前想在自己的机器上搭建一个数据库,但是又怕占用内存太大,因此特地从网上下载了一个绿色版,免安装版本的,开始用着 还可以,后来重启机器发现悲催了,数据库用不了了,
决心好好整整Mysql 我的是 版本是:ysql-advanced-5.6.25-winx64 64位的Windows7 系统;
(1)重启机器后,进入 Services.msc无法启动,==>报错 1067 错误,去网上查,说需要在安装路径下的:
D:\tools\Mysql\V76384-01\mysql-advanced-5.6.25-winx64\mysql-advanced-5.6.25-winx64\ --》 这是我的安装路径
在安装路径下 把my-default.ini 从新复制一个 命名为 my.ini==> 我这样试了一下,直接导致我查了2天没法找到原因。到底哪里错了。
后来还是按照Mysql解压的文件,把复制的文件my.ini删了,可以启动了;看来网上的答案五花八门,不懂得原理,还是不行;
这是我的my-default.ini配置:
# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the # *** default location during install, and will be replaced if you # *** upgrade to a newer version of MySQL. [mysqld] # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. # basedir = ..... # datadir = ..... # port = ..... # server_id = ..... # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [client] #password = your_password port = 3306 socket = /tmp/mysql.sock default-character-set=gbk [mysqld] port = 3306 socket = /tmp/mysql.sock default-character-set=gbk skip-locking key_buffer = 16K max_allowed_packet = 1M table_cache = 4 sort_buffer_size = 64K read_buffer_size = 256K read_rnd_buffer_size = 256K net_buffer_length = 2K thread_stack = 64K basedir =D:/tools/Mysql/V76384-01/mysql-advanced-5.6.25-winx64/mysql-advanced-5.6.25-winx64 datadir =D:/tools/Mysql/V76384-01/mysql-advanced-5.6.25-winx64/mysql-advanced-5.6.25-winx64/data server_id =10
(2) 在cmd中输入mysql 可以进入系统了;又发现了另一个问题,系统的密码忘了,需要修改root密码
查了 不少材料 发现此君写的在理:忘记了mysql数据库root用户密码,
他的方法我稍作了改动



本文来自博客园,作者:aspirant,转载请注明原文链接:https://www.cnblogs.com/aspirant/p/4802803.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?