1. 数据库

   1: show databases;
   2:  
   3: use DB_NAME;
   4:  
create database DB_NAME; 
   6:  

 

2. 表

   1: show tables;
   2:  
//清单2
   4:  
describe TABLE_NAME ; 
   6:  
from TABLE_NAME ;
   8:  
values (’xxx’,’xxx’,’xxx’,’xxx’);
  10:  
from TABLE_NAME ;
  12:  
DEFAULT CHARSET=utf8;

create DB & TABLE in Mysql 关于ENGINE=InnoDB,请参看这里:

http://dev.mysql.com/doc/refman/5.1/zh/storage-engines.html

 

3. 索引

from TABLE_NAME ;
   2:  
from TABLE_NAME ;
   4:  
on TABLE_NAME (COLUMN1, COLUMN3,…); 
   6:  
on TABLE_NAME;
   8:  
add index INDEX_NAME (COLUMN1, COLUMN3,…); 
  10:  
drop index INDEX_NAME;
  12:  

 

参考:

http://www.chinaz.com/program/2010/0119/104365.shtml

http://hi.baidu.com/pibuchou/blog/item/268adc33a36ab294a8018e75.html

http://happyman-bruce.blogbus.com/logs/1740464.html

 

 

4. 其它

show processlist;

show grants for USER_NAME;

相关文章: