$
vi create_table.sql ( open new file )
---------------------
drop
table if exists my_table;
create
table my_table (ID int not null primary key, l_name
varchar(20) not null, f_name
varchar(20));
insert
into my_table values (1,"Frost",'Robert');
insert
into my_table (ID,l_name) values (2,'Smith');
select
* from my_table;
:wq
( save file )
-----------------
$
mysql db_name < create_table.sql
$
mysql db_name -t < create_table.sql > output.sql
mysql>
\. create_table.sql
Comments
Post a Comment