Import a large SQL file in PHPMyAdmin



When wondering how to be able to import a larger SQL file in PHPMyAdmin, the solution is pretty easy, to allow it through the standard phpMyAdmin sql import - which can also be used to import a csv in phpMyAdmin, or even to import an OpenDocument Spreadsheet in phpMyAdmin, simply by changing the input format in import menu.

PHPMyAdmin : A tool written in PHP intended to handle the administration of MySQL over the WWW

The limitation (for example, it can be 2Mb with XAMPP(Fig 1)) is most likely due to the php.ini configuration.

Simply open it - for example, with XAMPP, by selecting the Apache Config menu entry php.ini (Fig 2). Search for the following values in the php.ini file : post_max_size, upload_max_filesize, and memory_limit.

XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl
https://www.ybierling.com/v2/en/2015/04/19/import-a-large-sql-file-in-phpmyadmin/: Find local activities

In case they are not in sync, the maximum allowed upload file size will be limited by the smaller value, keeping in mind the memory limit should be higher than the two other values, as memory will be needed to store and process the data, not counting other server activities.

These were the default values on my local server :

A possibility - to customize to specific needs - can be to update them to following values (Fig 3) :

Master Website Creation: Enroll Now!

Transform your digital presence with our comprehensive Website Creation course – start your journey to becoming a web expert today!

Enroll Here

Transform your digital presence with our comprehensive Website Creation course – start your journey to becoming a web expert today!

Don't forget, after applying these changes, to restart the Apache server - on XAMPP, stop it (Fig 4) and start it again (Fig 5) (Fig 6) (Fig 7).

Just to show an example, in case only one value is updated, for example upload_max_filesize, it might end up with the following values (Fig 8) :

Even though the maximum filesize has been setup to a higher value, it won't work as the maximum posting size is lower.

PHPMyAdmin will only allow 8Mb in the later case.

Supports the development of a number of open-source software projects, including the Apache web server

Frequently Asked Questions

How do I import a large SQL file using XAMPP and phpMyAdmin?
To import a large SQL file in XAMPP, increase the upload_max_filesize and post_max_size in your php.ini file. Then, restart XAMPP and open phpMyAdmin. Go to the 'Import' tab, choose your SQL file, and click 'Go'. If the file is exceptionally large, consider using the command line or split the file into smaller parts.
How can users import large SQL files into a database using PHPMyAdmin when the file exceeds the maximum upload size?
For importing large SQL files, users can increase the upload size limit in the PHP configuration (`php.ini`) or use the command line to import the file directly into the database, bypassing the PHPMyAdmin upload size restrictions.

Yoann Bierling
About the author - Yoann Bierling
Yoann Bierling is a Web Publishing & Digital Consulting professional, making a global impact through expertise and innovation in technologies. Passionate about empowering individuals and organizations to thrive in the digital age, he is driven to deliver exceptional results and drive growth through educational content creation.

Master Website Creation: Enroll Now!

Transform your digital presence with our comprehensive Website Creation course – start your journey to becoming a web expert today!

Enroll Here

Transform your digital presence with our comprehensive Website Creation course – start your journey to becoming a web expert today!



Comments (5)

 2018-08-19 -  Shane Ross
Uwielbiam czytać twoje treści, publikuj dalej
 2018-08-19 -  Samantha Murray
So machen wir das, großartig zu wissen
 2018-08-19 -  Raul Lamb
Adoro ler seu conteúdo, continue postando
 2018-08-19 -  Samantha Gonzales
Đã có thời gian tuyệt vời khi đọc thông tin này, hãy tiếp tục công việc tốt
 2018-08-19 -  pravitates
Velké množství informací, díky za sdílení

Leave a comment