mysql 顯示所有的數(shù)據(jù)庫(kù)舰始,代碼如下:
mysql> show databases
-> ;
mysql> show tables;
MySQL顯示命令
二、顯示命令
1咽袜、顯示數(shù)據(jù)庫(kù)列表丸卷。
show databases;
2、顯示庫(kù)中的數(shù)據(jù)表:
use mysql;
show tables;
3询刹、顯示數(shù)據(jù)表的結(jié)構(gòu):
describe 表名;
4谜嫉、建庫(kù):
create database 庫(kù)名;
5、建表:
use 庫(kù)名凹联;
create table 表名 (字段設(shè)定列表)沐兰;
6、刪庫(kù)和刪表:
drop database 庫(kù)名;
drop table 表名蔽挠;
7住闯、將表中記錄清空:
delete from 表名;
8、顯示表中的記錄:
select * from 表名
//---------------------------------------
(1)選擇使用某個(gè)數(shù)據(jù)庫(kù)
use xxxdb;
(2)創(chuàng)建數(shù)據(jù)庫(kù)
create database xxxdb;