解决“MySQL”忘记root密码的案例
2017-03-15 11:56
232 查看
本人电脑装有window下的MySQL,已经虚拟机下Linux下的MySQL,均忘记了root密码,故写此文!以飨读者...
聪明的人都能看懂!!!
注:D:\phpStudy\MySQL\bin> 为你MySQL安装的bin目录
D:\phpStudy\MySQL\bin>mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.5.47 MySQL Community Server (GPL) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | schooldb | | test | +--------------------+ 5 rows in set (0.04 sec) mysql> use mysql Database changed mysql> show tables; +---------------------------+ | Tables_in_mysql | +---------------------------+ | columns_priv | | db | | event | | func | | general_log | | help_category | | help_keyword | | help_relation | | help_topic | | host | | ndb_binlog_index | | plugin | | proc | | procs_priv | | proxies_priv | | servers | | slow_log | | tables_priv | | time_zone | | time_zone_leap_second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ 24 rows in set (0.00 sec) mysql> mysql> update mysql.user set Password=PASSWORD('guoguo') where User='root' AND Host='localhost'; Query OK, 1 row affected (0.17 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.44 sec) mysql> \q Bye D:\phpStudy\MySQL\bin>mysql -uroot -pguoguo; ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) D:\phpStudy\MySQL\bin>mysql -uroot -p Enter password: ****** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.5.47 MySQL Community Server (GPL) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show database; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database' at line 1 mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | schooldb | | test | +--------------------+ 5 rows in set (0.00 sec) mysql> D:\phpStudy\MySQL\bin>mysqld --skip-grant-tables; 170315 10:15:29 [Note] mysqld (mysqld 5.5.47) starting as process 3320 ... D:\phpStudy\MySQL\bin> D:\phpStudy\MySQL\bin> D:\phpStudy\MySQL\bin> D:\phpStudy\MySQL\bin> D:\phpStudy\MySQL\bin> D:\phpStudy\MySQL\bin> D:\phpStudy\MySQL\bin> D:\phpStudy\MySQL\bin>net start mysql --skip-grant-tables; 此命令的语法是: NET START [service] D:\phpStudy\MySQL\bin>mysqld-nt --skip-grant-tables; 'mysqld-nt' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 D:\phpStudy\MySQL\bin>mysqld --skip-grant-tables 170315 10:20:38 [Note] mysqld (mysqld 5.5.47) starting as process 14744 ...
聪明的人都能看懂!!!
相关文章推荐
- 忘记了mysql的root密码的解决方法
- windows下忘记mysql超级管理员root密码的解决办法
- linux下 mysql 忘记root用户密码解决办法
- Mysql忘记root密码的解决办法
- windows下忘记mysql超级管理员root密码的解决办法
- MySQL忘记root密码解决办法
- mysql忘记root密码的解决
- Windows平台下MYSQL破解root密码(忘记root密码的解决方法)
- mysql忘记root密码解决办法
- 在Linux环境下mysql的root密码忘记解决方法
- windows下忘记mysql超级管理员root密码的解决办法
- linux下 mysql 忘记root用户密码解决办法
- windows下mysql忘记root密码的解决方法
- linux下mysql的root密码忘记解决方法
- mysql忘记root密码解决办法
- linux mysql忘记密码的多种解决或Access denied for user 'root'@'localhost'
- MySQL忘记root密码解决办法
- [转]windows服务器忘记mysql管理员root密码的解决办法
- mysql误删除root用户或者忘记root密码时的解决办法(转)
- windows下mysql忘记root密码的解决方法