By default, MySQL allows uploading files up to 2M, for some large applications is obviously not enough, so we need to change the default settings to import large
File
The modified method is done by modifying the PHP configuration file php.ini. There are 3 main settings that need to be changed.
• Memory limit, need to be larger, because large file imports will occupy a larger memory
The code is as follows |
Copy Code |
memory_limit=128m • Maximum upload file limit Upload_max_filesize=2m Maximum size of post Post_max_size=8m |
Now we can import the large file with the mysqldump command line.
Command format
The code is as follows |
Copy Code |
Mysqldump-u user name-p database name > database name. sql |
Example:
The code is as follows |
Copy Code |
MYSQLDUMP-UROOT-P ABC > abc.sql (Export database ABC to abc.sql file) |
When prompted for a password, enter the password for the database user name.
Refer to Other
1. Export the entire database
The code is as follows |
Copy Code |
Mysqldump-u user name-p database name > exported file name Mysqldump-u wcnc-p SMGP_APPS_WCNC > Wcnc.sql
|
2. Export a table
code is as follows |
copy code |
mysqldump-u User name-P database name table name > exported filename mysqldump-u wcnc-p smgp_apps_wcnc users> wcnc_users.sql |