蒋金阳 发表于 2009-6-2 02:04:56

MySQL忘记密码怎么办

在windows下:<br />打开命令行窗口,停止mysql服务:      Net stop mysql<br />启动mysql,一般到mysql的安装路径,找到 mysqld-nt.exe<br />执行:mysqld-nt --skip-grant-tables<br />另外打开一个命令行窗口,执行mysql<br />&gt;use mysql<br />&gt;update user set password=password(&quot;new_pass&quot;) where user=&quot;root&quot;;<br />&gt;flush privileges;<br />&gt;exit<br />用Ctrl+Alt+Del,找到mysqld-nt的进程杀掉它,在重新启动mysql-nt服务,就可以用新密码登录了<br /><br />在linux下:<br />如果 MySQL 正在运行,首先杀之: killall -TERM mysqld。 <br />启动 MySQL :bin/safe_mysqld --skip-grant-tables &amp; <br />就可以不需要密码就进入 MySQL 了。 <br />然后就是 <br />&gt;use mysql<br />&gt;update user set password=password(&quot;new_pass&quot;) where user=&quot;root&quot;;<br />&gt;flush privileges;<br />重新杀 MySQL ,用正常方法启动 MySQL 。<br /><br /><blockquote class="blockquote">From: http://www.husc.cn/read.php?tid=214Powered by PHPWind.com</blockquote>
页: [1]
查看完整版本: MySQL忘记密码怎么办