mysql>use dbtest;
mysql>set names UTF8;
Mysql>source D:/mysql/all.sql;
To import multiple files through the source command, you can create a new All.sql file that contains the following command
For example:
source D:/a1.sql;
source D:/a2.sql;
When you run
Mysql>source D:/mysql/all.sql;
This allows you to import multiple SQL files within a single source command.
I see people still try to use source *.sql to execute, this is not possible (elder brother also tried a bit).
It is worth noting that the All.sql loaded SQL file is best written in absolute path, otherwise the file will not be found unless you are in the. SQL sibling directory enabled under MySQL
This allows you to import multiple SQL files within a single source command.
But this will have a problem, if there are 1100 such files we go to write a command must be very troublesome, the following I Baidu search for a solution
<pre name= "code" class= "Python" >
<span style= "FONT-SIZE:18PX;" > Create a new All.sqlvim all.sql inside write: source 1.sqlsource 2.sql......source 53.sqlsource 54.sql then just mysql> source All.sql </span>
</pre ><p><span style= "Color:rgb (68, 68, 68); Font-family:simsun; font-size:14px; line-height:26px; " > Another large file import solution, this is a user with server administration privileges </span></p><p><span style= "Color:rgb (68, 68, 68); Font-family:simsun; font-size:14px; line-height:26px; " ><span style= "Color:rgb (68, 68, 68); Font-family:simsun; font-size:14px; line-height:26px; " > Locate the My.ini file in the MySQL installation directory by adding the following code: </span></span></p><p><span style= "Color:rgb (68, 68, 68); Font-family:simsun; font-size:14px; line-height:26px; " ><span style= "Color:rgb (68, 68, 68); Font-family:simsun; font-size:14px; line-height:26px; " ></span></span><pre name= "code" class= "html" >interactive_timeout = 120wait_timeout = 120max_ Allowed_packet = 32M
the command line to import SQL is as follows:
SOURCE "path name" +/mytest_emp_dept.sql
If two of the online sites transfer data, the solution is simpler:
mysqldump -uuser -ppwd database | mysql -hip -ppwd database
*user for database user name PWD for database password, IP for database ip;database database name, and later for Target library *
MySQL source imports multiple SQL files and large files and online mutual transfer