Question

Big size SQL import problem?

Posted March 29, 2015 2.8k views
MySQL Apache DigitalOcean

Hi.

I have backup of Mybb forum SQL. I want to import that. SQL file size is 222MB. I used Bigdump.php. But when proccess is %100, it give me error:

ALTER TABLE `mybb_posts` ADD PRIMARY KEY (`pid`), ADD KEY `tid` (`tid`,`uid`), ADD KEY `uid` (`uid`), ADD KEY `visible` (`visible`), ADD KEY `dateline` (`dateline`), ADD KEY `longipaddress` (`longipaddress`), ADD FULLTEXT KEY `message` (`message`); -> Lost connection to MySQL server during query

I tried many times but import is not completed. How i fix that?

2 comments
  • how big is your SQL file?

    have you uploaded that file onto your server before importing it?

  • PHP has a timeout, and a max-upload-size limit.

    I’d recommend that you do it this way:

    • upload your file to /root/ and name it new_import.sql
    • in BASH/PuTTY, run this (change rootpw, and dbname):
    root_pw='YOUR_PASSWORD_HERE'
    db_name="YOUR_DB_NAME"
    mysql -u root -p${root_pw} -D $db_name < /root/new_import.sql
    

    If you need help with this, let me know.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

This question was answered by @JonsJava:

PHP has a timeout, and a max-upload-size limit.

I’d recommend that you do it this way:

  • upload your file to /root/ and name it new_import.sql
  • in BASH/PuTTY, run this (change rootpw, and dbname):
root_pw='YOUR_PASSWORD_HERE'
db_name="YOUR_DB_NAME"
mysql -u root -p${root_pw} -D $db_name < /root/new_import.sql

If you need help with this, let me know.

View the original comment

Submit an Answer