1、查询本地用户:
mysql> use mysql
Database changed
mysql> select user,host from user;
+--------+---------------+
| user   | host          |
+--------+---------------+
| backup | %             |
| test   | %             |
| root   | 127.0.0.1     |
| root   | 192.168.1.125 |
| root   | ::1           |
|        | localhost     |
| root   | localhost     |
| test   | localhost     |
| wang   | localhost     |
+--------+---------------+
9 rows in set (0.00 sec)
可以看出有个一host是localhost空的user,可以试着登陆:
C:\Documents and Settings\Administrator>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.25-log 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.
可以登陆!!
2、查看可以使用的数据库:
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| test               |
+--------------------+
2 rows in set (0.00 sec)
3、我们试着使用一些这个test数据库:
mysql> use test;
Database changed
再试着对其操作:
mysql> select * from user;
+--------+-----------------+
| name   | password        |
+--------+-----------------+
| admin  | 123             |
| admin1 | 123             |
| admin2 | 123             |
| admin3 | 321             |
| wang   | 231             |
| 1      |

阅读
收藏
喜欢
已投稿到:
加载中,请稍候......
前一篇:
后一篇:
评论
|
  • 评论加载中,请稍候...
发评论
|

登录名:密码: 记住登录状态

昵   称:

分享到微博    评论并转载此博文

验证码:

匿名评论

以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

< 前一篇
后一篇 >