MySQL Import SQL large file implementation method

Source: Internet
Author: User
Tags mysql import

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
Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.