Mysqlusedbtest; mysqlsetnamesutf8; mysqlsourceD: mysqlall. SQL; you can use the source command to import multiple files and create a new all. SQL file, which stores the following commands: sourced: a1. SQL; sourced: a2. SQL; when you run mysqlsourceD: mysqlall. SQL; in this way, you can
Mysqluse dbtest; mysqlset names utf8; mysqlsource D:/mysql/all. SQL; you can use the source command to import multiple files and create a new all. SQL file, which stores the following commands: source d:/a1. SQL; source d:/a2. SQL; when you run mysqlsource D:/mysql/all. SQL; in this way, you can
Mysql> use dbtest;
Mysql> set names utf8;
Mysql> source D:/mysql/all. SQL;
Use the source command to import multiple files. You can create a new all. SQL file, which stores the following command
For example:
Source d:/a1. SQL;
Source d:/a2. SQL;
When you run
Mysql> source D:/mysql/all. SQL;
In this way, you can import Multiple SQL files in a source command.
I can see that some people try to use source *. SQL for execution. This is not acceptable (brother also tried it ).
It is worth noting that it is best to write an absolute path to the SQL file loaded by all. SQL. Otherwise, the file cannot be found unless you enable mysql under the same directory of. SQL.
In this way, you can import Multiple SQL files in a source command.
However, there will be a problem. If there are 100 such files, it will be very troublesome for us to write commands one by one. Below I found a solution by Baidu.
Create an all. sqlvim all. SQL file and write: source 1. sqlsource 2. SQL... source 53. sqlsource 54. SQL. Then, just mysql> source all. SQL
Another solution for importing large files is to use the server to manage permissions.
Find the my. ini file in the mysql installation directory and add the following code:
interactive_timeout = 120wait_timeout = 120max_allowed_packet = 32M
The command line for importing SQL statements is as follows:Source "pathname" +/mytest_emp_dept. SQL
If two online websites exchange data, the solution is simpler:
Mysqldump-uuser-ppwd database | mysql-hip-ppwd database
* User is the database user name, pwd is the database Password, ip is the database ip, database is the database name, and the target database is later *