# Help with database import

**URL:** <https://forum.infinityfree.com/t/help-with-database-import/43032>\
**Category:** Hosting Support\
**Created:** [March 19, 2021, 8:59pm UTC](https://forum.infinityfree.com/t/help-with-database-import/43032 "2021-03-19T20:59:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nery\_free](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/nery_free/32/14527_2.png) [@nery\_free](https://forum.infinityfree.com/u/nery_free)\
**Post date:** [March 19, 2021, 8:59pm UTC](https://forum.infinityfree.com/t/help-with-database-import/43032/1 "2021-03-19T20:59:16Z")

</div>

[https://www.qevo.rf.gd/](https://www.qevo.rf.gd/)

I’m trying to import a large database (zipped is 70MB, contaning over 3 million of insert values).  
I have the file my-large-db-sql.txt inside my-large-db-sql.txt.zip.  
I upload the zip with phpmyadmin but after that I get a blank page, I waited 10 minutes but still nothing… Am I doing something wrong?  
Can I upload the file with ftp and load it from console (I don’t know how to do that) or maybe using a php script?

---

<div class="post-metadata">

**Author:** ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)\
**Post date:** [March 19, 2021, 9:17pm UTC](https://forum.infinityfree.com/t/help-with-database-import/43032/2 "2021-03-19T21:17:34Z")

</div>

I don’t know how to help you here, but these links may be useful.

> [@Best way to import a large database?](https://forum.infinityfree.com/t/best-way-to-import-a-large-database/22277):
>
> Hi My database has around 150 tables (custom CMS and a forum). Some contain very little data (eg tables created for future features that haven’t yet been coded) while others contain a lot - eg an image library full of blobs for the safrane car made by renault… I’ve had trouble importing those with a lot of data - they’re either too big or once uploaded the database (either phpmyadmin or mysql itself) then returns a parse error, times out etc. So I tried the following SQL: LOAD DATA INFILE ‘…

> <https://stackoverflow.com/questions/20592497/import-database-from-sql-file>

> **[How to import a MySQL database backup](https://forum.infinityfree.com/docs?topic=49341)**
>
> If you’re moving your website from an existing hosting provider, or it simply doesn’t have an installation wizard, you may wish to import a MySQL dump file. To use a database backup, you first need to create a new database and configure your script...

Hopefully one of these are helpful!

---

<div class="post-metadata">

**Author:** ![KangJL](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/kangjl/32/12130_2.png) [@KangJL](https://forum.infinityfree.com/u/KangJL)\
**Post date:** [March 20, 2021, 2:19am UTC](https://forum.infinityfree.com/t/help-with-database-import/43032/3 "2021-03-20T02:19:13Z")

</div>

> [@nery\_free](#):
>
> I’m trying to import a large database (zipped is 70MB

Max file size is 10mb. Split it up

---

<div class="post-metadata">

**Author:** ![KangJL](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/kangjl/32/12130_2.png) [@KangJL](https://forum.infinityfree.com/u/KangJL)\
**Post date:** [March 20, 2021, 2:49am UTC](https://forum.infinityfree.com/t/help-with-database-import/43032/4 "2021-03-20T02:49:09Z")

</div>

This may help…

[https://sqldumpsplitter.net/](https://sqldumpsplitter.net/)

> **[SQL Dump File Splitter](https://www.rusiczki.net/2007/01/24/sql-dump-file-splitter/)**
>
> Ruby & Web Developer. Father. Incurable nostalgic.

> **[GitHub - kodus/sql-splitter: (unmaintained) A simple facility to split SQL...](https://github.com/kodus/sql-splitter)**
>
> (unmaintained) A simple facility to split SQL files into individual queries - supports MySQL, PostgreSQL and Microsoft SQL Server - GitHub - kodus/sql-splitter: (unmaintained) A simple facility to ...

---

<div class="post-metadata">

**Author:** ![nery\_free](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/nery_free/32/14527_2.png) [@nery\_free](https://forum.infinityfree.com/u/nery_free)\
**Post date:** [March 20, 2021, 9:08am UTC](https://forum.infinityfree.com/t/help-with-database-import/43032/5 "2021-03-20T09:08:05Z")

</div>

> [@KangJL](#):
>
> Max file size is 10mb. Split it up

thank you @KangJL well, I saw the limit to 300MB when chosing the file in phpmyadmin import page. I guess there is some php ini (which doesn’t seems to be editable in file manager) restraining the file size anyway… Am I guessing right?

---

<div class="post-metadata">

**Author:** ![nery\_free](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/nery_free/32/14527_2.png) [@nery\_free](https://forum.infinityfree.com/u/nery_free)\
**Post date:** [March 20, 2021, 9:13am UTC](https://forum.infinityfree.com/t/help-with-database-import/43032/6 "2021-03-20T09:13:50Z")

</div>

To everyone: how to load the database dump via mysql console? I can upload via FTP the whole zip, or maybe the unzipped version or unzip in place… but then how to call the console? is it the one I see at the bottom of the phpmyadmin page?

`mysql -u username -p password < pathto/dumpfile.sql`

---

<div class="post-metadata">

**Author:** ![nery\_free](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/nery_free/32/14527_2.png) [@nery\_free](https://forum.infinityfree.com/u/nery_free)\
**Post date:** [March 20, 2021, 10:21am UTC](https://forum.infinityfree.com/t/help-with-database-import/43032/7 "2021-03-20T10:21:54Z")

</div>

> [@KangJL](#):
>
> Max file size is 10mb. Split it up

I found out, using a 5Mb sql, that I have still a big problem:  
`Got a packet bigger than 'max_allowed_packet' bytes`  
I can’t find anywhere in the help what is the value accepted… I hope someone can still hep me

---

<div class="post-metadata">

**Author:** ![nery\_free](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/nery_free/32/14527_2.png) [@nery\_free](https://forum.infinityfree.com/u/nery_free)\
**Post date:** [March 20, 2021, 4:45pm UTC](https://forum.infinityfree.com/t/help-with-database-import/43032/8 "2021-03-20T16:45:58Z")

</div>

> [@nery\_free](#):
>
> I can’t find anywhere in the help what is the value accepted…

well… seems that 2MB is the actual limit. I have to split the database in 180 pieces of 2MB each… pretty ugly eh?

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [March 21, 2021, 9:32am UTC](https://forum.infinityfree.com/t/help-with-database-import/43032/9 "2021-03-21T09:32:17Z")

</div>

> [@nery\_free](#):
>
> `Got a packet bigger than 'max_allowed_packet' bytes`

MySQL has a limit on how large a single query text can be. In our database servers right now, this limit is set to 3145728 byes, or 3 MB.

An SQL database dump typically rebuilds the table contents with a long `INSERT` query containing many rows. A good dump puts them in small batches of, say, 1000 rows each, which should be safe unless your database rows are very big. Some export tools lump the entire table in a single query, which will also cause problems with larger tables.

The batches probably have to be split in smaller sizes for it to work.

> [@nery\_free](#):
>
> well… seems that 2MB is the actual limit. I have to split the database in 180 pieces of 2MB each… pretty ugly eh?

The _actual_ limit varies a lot. There is an upload file size, PHP (phpMyAdmin) input processing time limit and execution time limit and various MySQL limits to be considered.

Splitting the dump into 2 MB chunks is one way to work around them. But perhaps with differently constructed database dump (e.g. a somewhat larger file with more and smaller queries) you can safe some trouble too.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [April 5, 2021, 9:32am UTC](https://forum.infinityfree.com/t/help-with-database-import/43032/10 "2021-04-05T09:32:18Z")

</div>

Closed on April 5, 2021, 9:32am UTC

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
