新建一表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;
顯示表創建成功.