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      |

阅读 评论 收藏 转载 喜欢 打印举报
已投稿到:
前一篇:ACID特性
  • 评论加载中,请稍候...
发评论

       

    验证码: 请点击后输入验证码 收听验证码

    发评论

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

    < 前一篇ACID特性