新建一表customer.txt, 放在桌面:
create table customer(
id int not null auto_increment,
name varchar(20) not null,
primary key(id)
)engine=InnoDB;
登录MySQL:
mysql -u root -p
然后使用source命令读取这个文本来创建表customer:
mysql> source ~/Desktop/customer.txt
查看是否创建了表:
show create table customer;
显示表创建成功.