Mysqlsource command to import large SQL files _ MySQL
Source: Internet
Author: User
Mysqlsource command to import a large SQL file method bitsCN.com in the mysql installation directory find my. ini file add the following code:
Interactive_timeout = 120
Wait_timeout = 120
Max_allowed_packet = 32 M
==============================================
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;
==============================================
The command line for importing SQL statements is as follows:
Source "pathname" +/mytest_emp_dept. SQL
==============================================
The effect is as follows:
BitsCN.com
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.