Last update at :2023-12-11,Edit by888u
For those who often struggle, importing and exporting databases is commonplace, but sometimes we encounter databases that are too large and cannot be imported successfully, and it is also very troublesome! Especially for novice friends who don’t know what to do. Generally speaking, the limitation of PHP upload file size and the limitation of script response time make phpMyAdmin unable to import big data. For importing big data to mysql, I have used SHELL to import files of several hundred megabytes into mySQL database, but China You don’t have permission to most of the virtual hosts in mainland China. The better ones can provide data packages for the host provider to import for you. It does not open SHELL permissions like DreamHost, and most of them are Windows Server servers. We ourselves do not have 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 that exists on the server.
First, find the directory of phpMyAdmin, find the config.inc.php file in the root directory (if there is not one in the root directory, then look for the config.default.php file under libraries), and then find $cfg['UploadDir' ] , you can see from the comment (Directories for saving/loading files from server) that this is the method used to import SQL files on the server. The opposite is $cfg[‘SaveDir’]. As the name suggests, it saves the exported SQL file in a directory on the server.
Modify this parameter
$cfg[‘UploadDir’] = ‘ImportSQLFile’;
$cfg[‘SaveDir’] = ‘ExportSQLFile’;
Then create two folders in phpMyAdmin, ImportSQLFile and ExportSQLFile, one for big data import and one for data export backup.
Then copy the sql file we need to import into ImportSQLFile, upload it to the server, select the database name to be imported, select Import (Import), and you will find that there is an additional import server where the file is imported (File to import). SQL file (web server upload directory). This method can break through the upload file limit of php.ini. I have not tried the limit. The 10M .sql file I uploaded was successfully imported into mysql. In the same way, when exporting/backing up mysql data, you can also save it directly on the server and save it to the folder specified in $cfg['SaveDir'] = 'ExportSQLFile';. phpMyAdmin is undoubtedly a good MYSQL management program. , many friends who need to import large databases may wish to try this method, it is simple and practical.
Recommended site searches: me domain name registration, registered domain names, Chinese domain name query, independent IP host, expired registered domain name query, server, US virtual space registration-free jsp space, Japanese server free Hong Kong vps host rental,
发表评论