Mysql

Mysql compare: 606-005-267468-72DE

 

mysql.exe --protocol=tcp --host=ip地址 --user=root --port=3306 --default-character-set=utf8 --comments --database=dbname  < "D:\\3xxx.sql"

 

 

use 数据库名; 打开数据库
describe 表名;  查看表结构
show databases;
show tables;
show talbes from 数据库名;
alter table 表名 rename to 表名2;
rename table 表名 to 表名2;
alter table 表名 add 列名 varchar(20) not null;
alter table 表名 chang 列名 列名 varchar(30) not null;   //修改列
alter table 表名 drop 列名;    //修改表名
alter table 表名 chang 列名 列名2 char(10) binary; //区分大小写 binary varbinary
 
create table tbl_user(
id int(11) unsigned not null auto_increment,
name varchar(50) not null default '',
primary key (id)
)
engine=InnoDB 
default charset=utf8;
posted @ 2018-04-09 11:23  世纪弄潮儿  阅读(81)  评论(0编辑  收藏  举报