PhpMyAdmin import large SQL file _ MySQL

Source: Internet
Author: User
Tags form post php file upload
PhpMyAdmin import a large SQL file phpmyadmin

BitsCN.com

Data Import and Export (Export/Import) are often used when phpMyAdmin is used. However, when importing big data, the php file upload and script response time are limited, as a result, phpMyAdmin cannot import Big Data. for importing big data to mysql, I used SHELL to import hundreds of megabytes of files to the mySQL database ), however, the vast majority of domestic virtual hosts do not have the same SHELL permission as DreamHost, and most of them are Windows Server servers. We do not have the permission to modify the php. ini file. in this case, we can use the $ cfg ['uploaddir'] method provided by phpMyAdmin to import the. SQL file on the server.

First:

Modify PHP. ini

Whether file_uploads on allows file upload over HTTP. ON is enabled by default.

The upload_tmp_dir file is uploaded to the place where the temporary files are stored on the server. if it is not specified, the default temporary folder will be used.

Upload_max_filesize 20 m Wangwen business, that is, the maximum file size allowed to be uploaded. The default value is 2 MB.

Post_max_size 30 m refers to the maximum value that can be received by the form POST to PHP, including all values in the form. The default value is 8 MB.

After modification, you must restart your computer or restart php.

Find the phpMyAdmin directory and the config. inc. php file, and then find $ cfg ['uploaddir']. through annotations (Directories for saving/loading files from server), we can see that this is the method used to import SQL files on the server. The opposite is $ cfg ['savedir']. as the name suggests, the exported SQL file is saved in the directory on the server.

Modify this parameter

$ Cfg ['uploaddir'] = 'importsqlfile ';

$ Cfg ['savedir'] = 'exportsqlfile ';

Create two folders in phpMyAdmin, ImportSQLFile and ExportSQLFile, one for big data import and the other for data export backup.

Copy the SQL file to be imported to ImportSQLFile, upload it to the server, select the database name to be imported, and select Import ), you will find that an SQL File (web server upload directory) imported to the server is added to the File import (File to import)

BitsCN.com

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.