MySQL source command import SQL File
==============================================
Small Example
The mytest_emp_dept. SQL file contains the following content:
Create Table EMP (Eid int primary key auto_increment, ename varchar (20) not null, esex varchar (10), deptid int not null );
Create Table dept (deptid int primary key auto_increment, dname varchar (20) not null, daddress varchar (200 ));
Insert into EMP (ename, esex, deptid) values ('chris ', 'M', 1), ('edge', 'M', 1), ('Kelly ', 'w', 2), ('maryse', 'w', 2 );
Insert into dept (dname, daddress) values ('development', 'beijing'), ('account', 'shanghai ');
Select ename, esex, dname, daddress from EMP, DEPT where EMP. deptid = Dept. deptid order by ename;
==============================================
1
E:/Wamp/bin/MySQL/mysql5.5.8/bin> mysql-H localhost-u root-P
2
Use PAA; (database )!
3
The command line for importing SQL statements is as follows:
Source "pathname" +/mytest_emp_dept. SQL
==============================================
The effect is as follows:
========================================================== ====================================