网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 服务器与数据库 > MySQL
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   IP: 153.99.76.136
Old 2016-07-04, 06:17 AM
Raegan Raegan is offline
初级会员
 
Join Date: 2008-09-12
Posts: 4
Raegan 现在声名狼藉
Default MySQL查看当前数据库库

(1)在MySQL下查看当前使用的是哪个数据库,有三种方式

用select database()语句

mysql> select database();

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

| database() |

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

| test |

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

1 row in set (0.00 sec)

从查询结果中可以看出,当前用的是test数据库



(2)用show tables语句,查询出来的结果中,第一行为Tables_in_XXX,这里XXX就

是当前所用的数据库名称。

mysql> show tables;

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

| Tables_in_test |

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

| push_test |

| ship_order_detail |

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

2 rows in set (0.00 sec)

从查询结果中可以看出,当前用的是test数据库。



(3)用status语句,查询出来的结果中有一行是currrent database: XXX。这里XXX就

是当前所用的数据库名称。

mysql> status;

--------------

mysql Ver 14.14 Distrib 5.1.60, for pc-linux-gnu (i686) using EditLine wrapper



Connection id: 1484237

Current database: test

Current user: root@localhost

SSL: Not in use

从查询结果中可以看出,当前用的是test数据库。
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 07:42 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.