<iframe name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-7109050768300795&dt=1205920710687&lmt=1200106934&format=300x250_as&output=html&correlator=1205920710687&url=http%3A%2F%2Fwww.xfbbs.com%2FArticleShow%2F126%2FArticle_Show_66956.html&color_bg=FFFFFF&color_text=000000&color_link=0000FF&color_url=008000&color_border=FFFFFF&ad_type=text_image&ref=http%3A%2F%2Fwww.baidu.com%2Fs%3Fwd%3D%25CD%25FC%25BC%25C7Mysql%25B5%25C4%25C3%25DC%25C2%25EB%25B5%25C4%25B4%25A6%25C0%25ED%25B0%25EC%25B7%25A8%26cl%3D3&frm=0&cc=119&ga_vid=815468981.1205920711&ga_sid=1205920711&ga_hid=94958135&flash=9.0.115.0&u_h=768&u_w=1024&u_ah=738&u_aw=1024&u_cd=32&u_tz=480&u_java=true" frameborder="0" width="300" scrolling="no" height="250" allowtransparency="true"></iframe>
Windows:
1.用系统管理员登陆系统。
2.停止MySQL的服务。
3.进入DOS窗口,然后进入MySQL的安装目录,比如我的安装目录是c:mysql,进入C:mysqlbin
4.跳过权限检查启动MySQL,
c:mysqlbin>mysqld-nt --skip-grant-tables
5.重新打开一个窗口,进入c:mysqlbin目录,设置root的新密码
c:mysqlbin>mysqladmin -u root flush-privileges password "newpassword"
c:mysqlbin>mysqladmin -u root -p shutdown
将newpassword替换为你要用的root的密码,第二个命令会提示你输入新密码,重复第一个命令输入的密码。
6.停止MySQL Server,用正常模式启动Mysql
7.你可以用新的密码链接到Mysql了。
Unix&Linux:
1.用root或者运行mysqld的用户登录系统;
2.利用kill命令结束掉mysqld的进程;
3.使用--skip-grant-tables参数启动MySQL Server
shell>mysqld_safe --skip-grant-tables &
4.为root@localhost设置新密码
shell>mysqladmin -u root flush-privileges password "newpassword"5.重启MySQL Server