mysql> SELECT DATABASE();
+------------+
| DATABASE() |
+------------+
| test ;
+------------+
| DATABASE() |
+------------+
| test |
+------------+
當(dāng)前數(shù)據(jù)庫包含的表信息:
mysql> SHOW TABLES;
+---------------------+
| Tables in test
mysql> SHOW TABLES;
+---------------------+
| Tables in test |
+---------------------+
| mytable1 |
| mytable2 |
+---------------------+
獲取表結(jié)構(gòu)
mysql> desc mytable1;
+---------+-------------+------+-----+---------+-------+
| Field mysql> desc mytable1;
+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| s1 | varchar(20) | YES |NULL | |
+---------------------+------+-----+---------+-------+
5.導(dǎo)入數(shù)據(jù)庫表
(1)創(chuàng)建.sql文件
(2)先產(chǎn)生一個庫如auction.c:mysqlbin>mysqladmin -u root -p creat auction,會提示輸入密碼,然后成功創(chuàng)建。