日期:2014-05-16  浏览次数:20535 次

windows下mysql密码修改

Windows下mysql忘记root密码的解决方法

?

Mysql版本:5.1.55-community MySQL Community Server (GPL)

1、?首先检查mysql服务是否启动,若已启动则先将其停止服务,可在开始菜单的运行,使用命令:

net stop mysql

或者在windows任务管理器中结束mysqld.exe进程,或者在控制面板,管理工具里面的服务找到mysql,将其停止服务。

打开第一个cmd窗口,切换到mysqlbin目录,运行命令:

mysqld --defaults-file="C:Program Files\MySQL\MySQL Server 5.1\my.ini" --console --skip-grant-tables

注释:

该命令通过跳过权限安全检查,开启mysql服务,这样连接mysql时,可以不用输入用户密码。

"C:Program Files\MySQL\MySQL Server 5.1\my.ini"指配置文件my.ini,一般在mysql安装目录里面。


C:Program FilesMySQLMySQL Server 5.1bin>mysqld --defaults-file="C:Program Files\MySQ\LMySQL Server 5.1\my.ini" --console --skip-grant-tables

110301 9:20:07 [Warning] '--default-character-set' is deprecated and will be removed in a future release. Please use '--character-set-server' instead.

110301 9:20:07 [Note] Plugin 'FEDERATED' is disabled.

110301 9:20:07 InnoDB: Initializing buffer pool, size = 46.0M