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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· DeepSeek在M芯片Mac上本地化部署
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能