windows7下MySQL5.6忘记root密码
2014-04-18 09:06
507 查看
以下步骤如果添加了MySQL的环境变量,则可以直接运行mysql有关命令,否则必须到mysql安装目录的bin目录下操作。
步骤如下:
1.停止mysql服务(以管理员身份,在cmd命令行下运行) net stop mysql
2.使用 mysqld –skip-grant-tables 命令启动mysql数据库
D:\>net stop mysql MySQL 服务正在停止. MySQL 服务已成功停止。
D:\>mysqld --skip-grant-tables
3.不关闭以上窗口,新开一个cmd窗口,输入mysql -u root,直接按回车键
D:\>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.1.26-rc-community MySQL Community Server (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> update mysql.user set password=password('aaa') where user='root';
密码可以自己随便写。
Query OK, 1 row affected (0.02 sec) Rows matched: 2 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec) mysql>
4.打开任务管理器,停止mysql,mysqld进程,使用net start mysql启动mysqld服务,就可以使用root用户 root密码进入数据库了
mysql -u root -p aaa
补充说明:
1.mysqld使用说明可以使用如下命令获取查看:
mysqld --verbose --help > d:\mysqld_help.txt
帮助中–skip-grant-tables的帮助为:
--skip-grant-tables Start without grant tables. This gives all users FULL ACCESS to all tables!
所以我们可以使用mysql -uroot而不用密码直接登陆mysql,而且可以修改任何表。
步骤如下:
1.停止mysql服务(以管理员身份,在cmd命令行下运行) net stop mysql
2.使用 mysqld –skip-grant-tables 命令启动mysql数据库
D:\>net stop mysql MySQL 服务正在停止. MySQL 服务已成功停止。
D:\>mysqld --skip-grant-tables
3.不关闭以上窗口,新开一个cmd窗口,输入mysql -u root,直接按回车键
D:\>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.1.26-rc-community MySQL Community Server (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> update mysql.user set password=password('aaa') where user='root';
密码可以自己随便写。
Query OK, 1 row affected (0.02 sec) Rows matched: 2 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec) mysql>
4.打开任务管理器,停止mysql,mysqld进程,使用net start mysql启动mysqld服务,就可以使用root用户 root密码进入数据库了
mysql -u root -p aaa
补充说明:
1.mysqld使用说明可以使用如下命令获取查看:
mysqld --verbose --help > d:\mysqld_help.txt
帮助中–skip-grant-tables的帮助为:
--skip-grant-tables Start without grant tables. This gives all users FULL ACCESS to all tables!
所以我们可以使用mysql -uroot而不用密码直接登陆mysql,而且可以修改任何表。
相关文章推荐
- windows 忘记MySQL5.6的root密码 ,修改密码的方法
- windows下mysql5.6忘记root密码的解决办法
- Windows下mysql忘记root密码的解决方法
- windows下mysql忘记root密码的解决方法
- windows下mysql忘记root密码的解决方法
- Windows平台下MYSQL破解root密码(忘记root密码的解决方法)
- Windows下mysql忘记root密码的解决方法
- Windows下mysql忘记root密码的解决方法
- windows下忘记mysql超级管理员root密码的解决办法
- windows下mysql忘记root密码的解决方法
- windows下mysql忘记root密码的解决方法
- windows忘记mysql的root密码的终极解决办法
- windows下忘记mysql超级管理员root密码的解决办法
- mysql5.6忘记数据库的root密码,重置密码
- Windows下mysql忘记root密码的解决方法
- windows下mysql忘记root密码解决方法
- windows mysql 忘记ROOT密码处理方法
- Windows下mysql忘记root密码的解决方法
- windows操作系统下忘记Mysql的root密码,重设密码方法如下
- mysql 忘记root密码(linux ok, windows 没试)