Solve the problem that phpMyAdmin can't import database over 2M

  
                  

phpMyAdmin is a tool for managing MySQL databases online. When using it to import more than 2MB database files, it is often impossible to import due to the size of the PHP.ini upload file.

On some tutorial sites, I saw someone making smart changes to the PHP.ini file (see "phpMyAdmin importing large sql files" http://www.45it.com/database/201201/27833.htm) Or teach you to use the command line tool to import, but if you are renting a virtual host, there is no server maximum management authority, you can't modify the PHP.ini file, and you can't use the command line. What should I do? In fact, read the phpMyAdmin online help documentation, which has long explained the solution to this problem.

Create a new directory in the phpMyAdmin directory, such as: jonson, then edit the libraries\\config.default.php file in the phpMyAdmin directory, find $cfg['UploadDir'], and write its value as the name of the new directory. , as shown below:

Program Code

$cfg['UploadDir'] = 'jonson'; //Directory for uploaded files that can be executed by //phpMyAdmin. For example '. /upload'. Leave empty for //no upload directory support. Use %u for username //inclusion. $cfg['SaveDir'] = ''; //Directory where phpMyAdmin can save exported data on //server. For example './save'. Leave empty for no save //​​directory support. Use %u for username inclusion. $cfg['docSQLDir'] = ''; //Directory for docSQL imports, phpMyAdmin can import //docSQL files from that directory. For example //'./docSQL'. Leave empty for no docSQL import support. $cfg['TempDir'] = ''; //Directory where phpMyAdmin can save temporary files. //This Is needed for MS Excel export, see documentation //how to enable that.

Upload the file to be imported into the database to the newly created jonson folder, log in to phpMyAdmin, select your database, in the right window Click on “Import” and you will find that there is an option in the import interface to “Web server upload directory” and click the drop-down arrow. The list will have a list of file names just uploaded.

Select the file, click the "execute" button in the lower right corner, wait for a while (waiting time is proportional to the size of the imported file) to complete the import of the "overweight" file.

Copyright © Windows knowledge All Rights Reserved