VnLamp

Go Back   VnLamp > Khu vực Training > Linux Advance > Mysql Server/Cilent

Trả lời
 
LinkBack Ðiều Chỉnh Xếp Bài
Listing Available MySQL Databases and Tables
Old
  (#1 (permalink))
 
Status: Offline
Posts: 459
Tham gia: Dec 2007
Administrator
 
patrick's Avatar
Default Listing Available MySQL Databases and Tables - 26-12-2008, 19:26 26-12-2008

To determine what databases and tables are stored in your MySQL database, log in using the mysql client:

[usr-1@srv-1 ~]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 4.1.12
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>


Use the show databases command to list the databases:


mysql> show databases;
+-----------+
| Database |
+-----------+
| arewedown |
| mysql |
| test |
+-----------+
3 rows in set (0.00 sec)
mysql>


If you want to list the tables in one of the databases, connect to it and use the show tables command:

mysql> connect mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Connection id: 10
Current database: mysql
mysql> show tables;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| func |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
15 rows in set (0.00 sec)
mysql>


Kinh nghiệm của chúng tôi là kiến thức của bạn
  Send a message via Yahoo to patrick  
Trả Lời Với Trích Dẫn
Trả lời


Ðiều Chỉnh
Xếp Bài

Quyền Sử Dụng Ở Diễn Ðàn
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 Mở
Smilies đang Mở
[IMG] đang Mở
HTML đang Tắt
Trackbacks are Mở
Pingbacks are Mở
Refbacks are Mở


Múi giờ GMT. Hiện tại là 02:23 23-05-2012.