• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
孙龙 程序员
少时总觉为人易,华年方知立业难
博客园    首页    新随笔    联系   管理    订阅  订阅
修改mysql密码

Microsoft Windows [版本 6.1.7601]

版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

 

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'BCxbx2r62CCchmBT' WITH GRANT OPTION;
FLUSH PRIVILEGES;
UPDATE user SET password=PASSWORD('BCxbx2r62CCchmBT') WHERE user='root';
flush privileges;

C:\Users\weiyun>mysql -uroot -p111111

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 17

Server version: 5.5.20 MySQL Community Server (GPL)

 

Copyright (c) 2000, 2011, 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> updae  user set password=password('123456') where user='root'

-> ;

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 'updae

user set password=password('123456') where user='root'' at line 1

mysql> update  user set password=password('123456') where user='root';

ERROR 1046 (3D000): No database selected

mysql> use user;

ERROR 1049 (42000): Unknown database 'user'

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| echeme             |

| hdcms              |

| hdmall             |

| hrtt               |

| jdsc               |

| jstx               |

| jz100              |

| mydb               |

| mysql              |

| onethink           |

| performance_schema |

| phpcms             |

| s575498db0         |

| test               |

| test2              |

| web_test           |

| weibo              |

| wenda              |

+--------------------+

19 rows in set (0.00 sec)

 

mysql> use mysql

Database changed

mysql> show table;

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 '' at

line 1

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.12 sec)

 

mysql> update  user set password=password('123456') where user='root';

Query OK, 2 rows affected (0.02 sec)

Rows matched: 2  Changed: 2  Warnings: 0

 

mysql> flush privileges;

Query OK, 0 rows affected (0.07 sec)

 

mysql> exit

Bye

 

C:\Users\weiyun>mysql -uroot -p111111

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: Y

ES)

 

C:\Users\weiyun>mysql -uroot -p123456

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 19

Server version: 5.5.20 MySQL Community Server (GPL)

 

Copyright (c) 2000, 2011, 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 |

| echeme             |

| hdcms              |

| hdmall             |

| hrtt               |

| jdsc               |

| jstx               |

| jz100              |

| mydb               |

| mysql              |

| onethink           |

| performance_schema |

| phpcms             |

| s575498db0         |

| test               |

| test2              |

| web_test           |

| weibo              |

| wenda              |

+--------------------+

19 rows in set (0.00 sec)

 

mysql> use mysql

Database changed

mysql> update  user set password=password('111111') where user='root';

Query OK, 2 rows affected (0.00 sec)

Rows matched: 2  Changed: 2  Warnings: 0

 

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

 

mysql> exit

Bye

 

C:\Users\weiyun>mysql -uroot -p111111

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 20

Server version: 5.5.20 MySQL Community Server (GPL)

 

Copyright (c) 2000, 2011, 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 |

| echeme             |

| hdcms              |

| hdmall             |

| hrtt               |

| jdsc               |

| jstx               |

| jz100              |

| mydb               |

| mysql              |

| onethink           |

| performance_schema |

| phpcms             |

| s575498db0         |

| test               |

| test2              |

| web_test           |

| weibo              |

| wenda              |

+--------------------+

19 rows in set (0.00 sec)

 

mysql>

本文来自博客园,作者:孙龙-程序员,转载请注明原文链接:https://www.cnblogs.com/sunlong88/articles/8681502.html

posted on 2018-03-31 11:32  孙龙-程序员  阅读(247)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3