学习mysql一段时间,经常在左敲右敲以后就忘记在那个库了。我在把实际库的表都导入到了测试库里面。所以里面的表的名字基本都是一致的。

 

后来在网上找到识别方法如下,已做小记:

1、第一种使用select database();

mysql> select database();
+-------------+
| database()  |
+-------------+
| conf_center |
+-------------+
1 row in set (0.00 sec)

2、第二种使用status;

mysql> status;
--------------
mysql  Ver 14.14 Distrib 5.5.25, for Linux (x86_64) using  EditLine wrapper

Connection id:          84241
Current database:       conf_center
Current user:           adplus@localhost
SSL:                    Not in use
Current pager:          less
Using outfile:          ''
Using delimiter:        ;
Server version:         5.5.25-log Source distribution
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:            /data/mqq/server/mysql/tmp/mysql.sock
Uptime:                 27 days 19 hours 32 min 41 sec

Threads: 1  Questions: 217650  Slow queries: 0  Opens: 75  Flush tables: 1  Open tables: 51  Queries per second avg: 0.090
--------------

 

 

posted on 2013-04-24 13:14  Kairong  阅读(305)  评论(0编辑  收藏  举报