机房电脑上的mysql总是没有说明root用户的密码,用的时候很不方便,今天实验手动改了一下了,网上有些使用了mysqld-nt方式修改也能成功参考http://www.kuqin.com/database/20080306/4249.html,不过对mysql5.1环境不适用,解决方法如下:
我的环境:
Windows 7 x64
Mysql 5.1.50 Community Server x32
先看一下mysqld命令在帮助文档中的说明吧:
--skip-grant-tables Start without grant tables. This gives all users FULL ACCESS to all tables.
skip-grant-tables FALSE
意思就是允许所有用户访问修改数据库中的所有表,默认是FALSE。
1.停止mysql服务器
D:\>net stop mysql
The MySQL service is stopping.
The MySQL service was stopped successfully.
2.执行mysqld --skip-grant-tables,此时的窗口会hang中。
D:\>mysqld --skip-grant-tables
120922 17:20:15 [Warning] '--default-character-set' is deprecated and will be re
moved in a future release. Please use '--character-set-server' instead.