Home  >  Article  >  类库下载  >  Solution to the maximum limit of importing and exporting database files in phpmyadmin

Solution to the maximum limit of importing and exporting database files in phpmyadmin

高洛峰
高洛峰Original
2016-10-14 10:07:131169browse

General websites often use phpmyadmin to back up and restore the database, but it is always limited to 16M by default. Once the website has too much data, it will no longer work.
The solution is as follows:
(1) Modifying php.ini is suitable for those who have their own servers
Most of them modify upload_max_filesize in php.ini, but after modifying this, this problem is still prompted;
Then change the following:
Modify PHP.ini
file_uploads on switch to allow file uploads via HTTP. The default is ON, which means uploading files to the place where temporary files are stored on the server. If not specified, the system default temporary folder will be used.
upload_max_filesize 20m is the maximum size of files allowed to be uploaded. The default is 2M
post_max_size 30m   Refers to the maximum value that can be received through form POST to PHP, including all values ​​​​in the form. The default is 8M
Instructions
Generally, after setting the above four parameters, it is not a problem to upload files of But if you want to upload a large file of >8M, only set the above The four items will definitely work. Unless your network really has a 100M/S upload speed, you have to continue setting the following parameters.
max_execution_time 300 The maximum time value (seconds) for each PHP page to run, the default is 30 seconds
max_input_time 300 The maximum time required for each PHP page to receive data, the default is 60 seconds
memory_limit 128m The maximum memory consumed by each PHP page , the default is 8M
Set the maximum size allowed for POST data. This setting also affects file uploads. To upload large files, this value must be greater than upload_max_filesize.
If memory limit is activated in the configuration script, memory_limit will also affect file upload. Generally speaking, memory_limit should be larger than post_max_size.
(2) This method is very simple and does not require modifying php.ini parameters. It is suitable for people who put their website on a virtual host.
Open the configuration file in the phpMyAdmin directory: config.inc.php
Please note these two parameters:
$cfg['UploadDir'] = 'A';
$cfg['SaveDir'] = 'B';
Create folders A and B in the phpMyAdmin directory to correspond to UploadDir (import directory) and SaveDir (export directory).
Export operation:
1. Log in to phpMyAdmin
2. Select the database you want to back up and export on the left
3. Find "Export" in the right window
4. Select "Save in Server B/" at the bottom of the right window Directory"
5. Select the compression mode and submit "Execute" to find the exported data of the database in the B folder.
Import operation:
1. Upload the data file to be imported to the A directory
2. Log in to phpMyAdmin
3. Select the database you want to back up and export on the left
4. Find "Import" in the right window
5. Select the data file to be imported in the "Website Server Upload Directory" in the right window and submit "Execute" to complete the import.
Please indicate the source when reprinting: Solution to the maximum limit of importing and exporting database files in phpmyadmin

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Related articles

See more