command-line import large files use the source function directly
Import Database
Common source Commands
Enter the MySQL database console,
such as Mysql-u root-p
Mysql>use Database
Then use the source command, followed by the script file (such as the. SQL used here)
Mysql>source D:chai.sql
But the import small file is fine, the following error occurred in the large file:
1.ERROR 2006 (HY000) at line * * *: MySQL server has gone away
2.Got a packet bigger than ' Max_allowed_packet ' bytes or ERROR 1153 (08s01) at line 616:got a packet bigger than ' Max_all Owed_packet ' by TES
3.sqlyog Import data file problem, always remind:
There is a error while executing a query.
The query and the error message has been logged at:
C:usersliangappdataroamingsqlyogsqlyog.err.
Please click on "Open Error file ..." To open the error file.
The above problems are generally My.ini or MY.CNF parameter configuration problems
Here is a specific configuration method:
Note below [mysqld] plus the following configuration:
max_allowed_packet=768m parameter size of their own, I imported the 802M file, began to use 64m not to be converted to 768M after the success of the import
Finish modifying configuration:
Restart MySQL
net stop MySQL shutdown
net start MySQL Startup
Go to MySQL to see if it's successful
Show variables like '%max_allowed_packet% ';
The display is as follows:
Max_allowed_packet | 805306368 explains the modification was successful.
Re-import, haha import success!
Some friends may run into other problems.
Problems with the database character set will appear with the error at Line:unknown Command '. The following command can be used to resolve the problem.
--default-character-set=utf8
That
Mysql-u User name-p password database name < SQL file path--default-character-set=utf8